Function overloading in C

前端 未结 5 1967
花落未央
花落未央 2020-12-10 01:23

Today, looking at the man page for open(), I\'ve noticed this function is \'overloaded\':

   int open(const char *pathname, int flags);
   int o         


        
5条回答
  •  情深已故
    2020-12-10 01:30

    "mode must be specified when O_CREAT is in the flags, and is ignored otherwise."

    extern int open (__const char *__file, int __oflag, ...)

    It uses varargs and only loads the mode variable argument if __oflag contains O_CREAT.

提交回复
热议问题