#include<stdio.h>
Hi,
I would like to know why i am getting a segmentation fault when i run this code, also i want to write the statement as it is into file.txt just changing the value of m in m.dat without changing the format which i am not getting .Can someone help me with this??
main()
{
FILE * fp;
int i=1;
fp = fopen ( "file.txt","w");
for(i=1;i<10;i++){
fputs("c:\My Documents\Folder1\Input1\m.dat xyz.dat\n",fp);
fseek(fp,26,SEEK_SET);
fputc(i,fp);
}
fclose(fp);
}
Hi,
I would like to know why i am getting a segmentation fault when i run this code, also i want to write the statement as it is into file.txt just changing the value of m in m.dat without changing the format which i am not getting .Can someone help me with this??
main()
{
FILE * fp;
int i=1;
fp = fopen ( "file.txt","w");
for(i=1;i<10;i++){
fputs("c:\My Documents\Folder1\Input1\m.dat xyz.dat\n",fp);
fseek(fp,26,SEEK_SET);
fputc(i,fp);
}
fclose(fp);
}