求教 文件指针问题!
#include <stdio.h>
#include <string.h>
main()
{
char *str1 = "guo";
char* ptr;
FILE * fp;
char *str;
if((fp=fopen("db","rb"))==NULL)
{
printf("can not open");
}
str=(char*)fp;
ptr = strstr(str, str1);
printf("The substring is: %s\n", ptr);
}
db是一个文本文件,运行是为什么打不开呀,还有fp的类型转换和strstr的用法对 吗,希望各位多多指教!!!!!