Write file

Lennie

New Member
Nov 2, 2019
2
0
1
I have the following cc65 program to write a plain text file.
When I run this in the X16 emu release 33 i don't see the file on my local file system ?

#include <stdio.h>

#define LEN 256
int main ()
{
FILE * fp;
int i;
/* open the file for writing*/
fp = fopen ("1.txt","w");

/* write 10 lines of text into the file stream*/
for(i = 0; i < 10;i++){
fprintf (fp, "This is line %d\n",i + 1);
}

/* close the file*/
fclose (fp);
return 0;
}