其中定义了open(char *filename, int access, int permission)

Where is the open( char *filename, int access, int permission) defined?

本文关键字:int filename access permission char 定义 open      更新时间:2023-10-16

我必须在c/c++中包含什么文件才能使用open()函数?我已经包含了fcntl.h, stdio.h和Visual Studio仍然告诉我"open"没有定义

如文档所示:

_open已被弃用,而支持_sopen_s

在每个链接的页面底部,您将看到两个函数所需的标题。

#include <io.h> // REQUIRED
#include <fcntl.h> // OPTIONAL
#include <systypes.h> // OPTIONAL
#include <sysstat.h> // OPTIONAL
#include <share.h> // OPTIONAL FOR _sopen_s