I am trying to name a text file, but i need to name it something that varies.
INPUTread = fopen("Type I-A.txt", "r");
How can I name the file = m_somevariablenum " Type I-A.txt" so that it would look somthing like this "399 Type I-A.txt"
Thanks,
Printable View
I am trying to name a text file, but i need to name it something that varies.
INPUTread = fopen("Type I-A.txt", "r");
How can I name the file = m_somevariablenum " Type I-A.txt" so that it would look somthing like this "399 Type I-A.txt"
Thanks,
Code:char filename[128];
FILE *out;
int value;
value = 128;
sprintf (filename,"%d Type I-A.txt", value);
out=fopen(filename,"w");