FILE *fp;
int main()
{
init_platform();
int a, b, c, d, e;
a = 20;
b = 10;
c = 40;
d = 50;
e = 60;
fp = fopen("etc/dump.txt", "w");
if (NULL == fp)
t printf("Cannot open file");
if (fp)
{
fprintf(fp, "%d
", a);
tfprintf(fp, "%d
", b);
tfprintf(fp, "%d
", c);
tfprintf(fp, "%d
", d);
tfprintf(fp, "%d
", e);
fflush(fp);
t fclose(fp);
}
printf("Hello World
r");
return 0;
}
In above program I didn't get file pointer fp address. I got 0x0 and output is Cannot open file
Help me how to create a file using file pointer