如题所述
比如我想用程序运行的当前路径和当前的系统时间作为一个文件的名字作为文件的创建路径,来创建这个文件
嗯。假定这个文件名存在字符串变量fname[]中,则可进行如下操作FILE *tfp = fopen(fname,"w");这个文件就被创立了,接下来进行写入操作,完成后,别忘记关闭文件指针,fclose(tfp);。