开发者

Function parameters

开发者 https://www.devze.com 2023-02-27 05:43 出处:网络
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).

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

精彩评论

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