我试图找到一种使用方法,
FILE * fopen ( const char * filename, const char * mode );
但间接传递文件名。我还想知道如何间接调用名称直接取自 argv[] 的函数。我不想将字符串存储在缓冲区字符数组中。例如:
int main (int argc,char *argv[])
{
FILE *src;
...
src = fopen("argv[1]", "r"); //1st:how to insert the name of the argv[1] for example?
...
function_call(argc,argv); //2nd:and also how to call a function using directly argc argv
...
}
void create_files(char name_file1[],char name_file2[])
{...}
我是否必须存储长度和字符串才能调用函数?(关于第二个问题):)