这个是指针为空指针吗?可以编译,不能执行
#include<stdio.h>#include<stdlib.h>
#include<string.h>
#define LEN 100
int main()
{
FILE *f,*fp;
int i,j;
char name[LEN];
long m;
if((f=fopen("test.txt","rb+"))==NULL)
{
printf("can't open this file");
exit(1);
}
for(i=1;i<=100;i++)
{
char a[1024];
m=(long)(1048576*(i-1));
fseek(f,m,SEEK_CUR);
strcpy(name,i);
if((fp=fopen(name,"wb+"))==NULL)
{
printf("error");
exit(2);
}
for(j=0;j<1024;j++)
{
fread(a,sizeof(char),1024,f);
fwrite(a,sizeof(char),1024,fp);
}
fclose(fp);
}
fclose(f);
return 0;
}