This is one of my attemps but it doesnt work! im out of ideas google wasnt verry helpfull.
Thanx in advance!
breekbot
#include <stdio.h>
main() {
char filename[20];
printf("Enter filename:\n");
scanf("%c",&filename);
FILE *file;
file = fopen("path to filename %c", "w+", filename); /* <-----------this doesnt work*/
if(file==NULL) {
printf("Error: can't create file.\n");
return 1;
}
else {
printf("File created. Now closing it...\n");
fclose(file);
return 0;
}
}
This post has been edited by breekbot: 01 August 2008 - 08:55 AM

New Topic/Question
Reply




MultiQuote





|