求助 c语言 读写数据到指定文件
请问一下以下程序错在哪?# include <stdio.h>
int a[2];
void main()
{int i;
int readdat(void);
void writedat(void);
for (i=0;i<2;i++)
printf("%d",a[i]);}
int readdat(void)
{FILE *in;
in=fopen("F:\\in.txt","r");
for (i=0;i<2;i++)
fscanf(in,"%d",&a[i]);
fclose(in);}
void writedat(void)
{
FILE *out;
out=fopen("F:\\out.txt","w");
for (i=0;i<2;i++)
fprintf(out,"%d",a[i]);
fclose(out);}