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.
精彩评论