This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C语言fprintf()和fscanf()问题



是这样的,我想从txt文档里用fscanf()循环读1000个整数,然后做一下处理,再用fprintf()循环写1000个数到一个新的txt里。但是程序每次执行到写循环时都会出错。

错误信息是这样的:No source available for "0x0"

 

程序代码如下:

FILE *input;

FILE *output;

DATA x[1000]={0};

DATA r[1000]={0};

DATA db[1002]={0};

DATA h[4]={0};

void main(void) {

 int i;  long int num;

// for (i=0; i<1000; i++) r[i] = 0;       // clear output buffer (optional)

// for (i=0; i<1000+2; i++) db[i] = 0;      // clear delay buffer (a must)  

input=fopen("kx6.txt","r+");  

for(i=0;i<1000;i++){   

     fscanf(input,"%ld",&num);  

     x[i]=(DATA)(num>>8);   }

// fir(x,h,r,db,64,1000);  

fclose(input);  

output=fopen("output.txt","w");  

for(i=0;i<1000;i++){   fprintf(output,"%d\n",x[i]);  }  

fclose(output);  

while(1); }