这是如何实现的?我要用
pFile = fopen( file, "rb" );
其中 file 是一个 char、string 或 long,包含包含二进制文件本地路径的文字文本
C:\Documents and Settings\Supernovah\Desktop\Supernovah.bin
当然会崩溃。
我也对如何以一种可移植的方式在当前目录上循环感兴趣。 windows.h 有点难看,但如果我不能以可移植的方式做到这一点。就这样吧。
谢谢:)
最佳答案
char* file="C:\\Documents and Settings\\Supernovah\\Desktop\\Supernovah.bin";
FILE* pFile = fopen( file, "rb" );
关于c - 在C中的另一个目录中打开文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1547440/