开发者

Function parameters

What I have to put as second parameter in this function? I need to unders开发者_StackOverflow社区tand the meaning of int (*fn)(const char *, const struct stat *ptr, int flag).

int 
ftw(const char *path, int (*fn)(const char *, const struct stat *ptr, int flag), 
int depth);

Thank you!!


 int (*fn)(const char *, const struct stat *ptr, int flag)

is a pointer to a function that returns an int and takes a const char*, a const struct stat *, and an int.

If you had this function:

 int func (const char *s, const struct stat *ptr, int flag)
 {
      return 0;
 }

You could pass func as that argument.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜