用那个API判断文件是否存在?
有很多方法,但一般那个方法最方便?具体代码实现是怎样。
[解决办法]
- C/C++ code
char *name = "C:\\Users\\administrator\\Desktop\\temp"; FILE *f = NULL; try { f = fopen(name,"r"); if (f==NULL) { cout<<"not file"<<endl; } else { cout<<"is file"<<endl; fclose(f); } } catch (CException* e) { cout<<"exception"<<endl; }