I wanna ask you, if is it possible to have user inputed name of FILE*... something like this:
#include <stdio.h>
int main() {
char* name1, name2, path1, path2;
printf("Insert first file name and path\nExample: file, c:\\path\\to\\file.txt");
scanf("%s, %s", name1, path1);
printf("Insert second file name and path\nExample: file, c:\\path\\to\\file.txt");
scanf("%s, %s", name2, path2);
FILE* name1;
FILE* name2;
name1 = fopen(path1, "a+");
name2 = fopen(path2, "a+");
...
}
So on the console will be:
Insert file name and path
Example: file, c:\path\to\file.txt
so if user inserts:
File1, c:\file1.txt
File2, c:\file2.txt
I would like the "code" to look something like this:
FILE* File1;
File1 = fopen("c:\file1.txt", "a+");
FILE* File2;
File2 = fopen("c:\file2.txt", "a+");
Thanks for help ;)