FILE *fptr1;
char str[10];
fptr1=fopen("D:\\New Folder\\test.txt","rb")
//Now I want to replace text.txt with my string.Just want to know the syntax :/
答案 0 :(得分:0)
很难理解,你需要什么。可能你正在寻找这样的东西:
char str[] = "D:\\New Folder\\test.txt";
FILE *fptr1 = fopen(str, "rb");
答案 1 :(得分:0)
没有这种方法可以直接编辑fptr1
包含的内容。
FILE *fptr1;
char str[10];
//char fileName[50] = "test.txt";
char path[500] = strcat("D:\\New Folder\\","test.txt");
fptr1=fopen(path,"rb");