level 6
要循环打开名为"chang001""chang002"...."changXXX"的n个文件该怎么办?
2006年05月31日 07点05分
1
level 3
#include
#include
#include
#include
#include
#pragma hdrstop#pragma argsusedusing namespace std;int main(int argc, char* argv[]){ char a[100]="C:/Documents and Settings/Administrator/桌面/chang",b[100],c[]="0"; int j; cin>>j; for(int i=0;i
2006年05月31日 09点05分
3
level 9
都用这样的办法的HOHO,只不过生成文件名最好独立成一个函数,因为这个功能应该是随需求变化的,c[]好像只能生成a0.txt a1.txt这样的吧。 比如你可以生成下面的函数: BOOL CreateFileName(const String OrgFileName,const String FileExName,int Index,String &FileName) 然后这么做,就把功能和流程分开了: String a = "chang",b=".txt",c="",&d=c; for(int i=0;i
2006年06月01日 02点06分
7
level 9
至于这个CreateFileName 以后想怎么改就怎么改,主流程是无关的呵呵
2006年06月01日 02点06分
8