在Windows环境下打开文件的方式有很多种.下面一一列举
1.C语言:
函数FILE fopen(const char* path, const char* mode);
2.C++语言:
fstream类:fstream file;file.open(const char* filename, ios_base::openmode);
3.Windows系统API:
int _open(const char* filename, int oflag[, int mode]);
4.Windows系统API:
HANDLE WINAPI CreateFile(
__in LPCTSTR lpFileName,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile
);