Today, looking at the man page for open()
, I've noticed this function is 'overloaded':
int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
I didn't thought it's possible on C. What's the 'trick' for achieving this ?
LATER EDIT:
So it's not really overloading, because when using varargs - you can only supply multiple arguments of the same type. So, is mode_t
behind the scenes an int ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…