开发者

Confusion about const syntax

开发者 https://www.devze.com 2023-03-07 03:53 出处:网络
I\'m having some trouble reading a line in a program that looks like this: char* const *(*next) (); I think next is a pointer to a function returning a p开发者_开发百科ointer to a const pointer to

I'm having some trouble reading a line in a program that looks like this:

char* const *(*next) ();

I think next is a pointer to a function returning a p开发者_开发百科ointer to a const pointer to a char, but I'm still a bit confused. If someone could answer this ASAP that would be great!


cdecl can help you understand the more complicated declarations in C.


char* const* (*next) ();

You are declaring a function pointer called next that returns a char* const* (pointer to a char* const). You were right (:

Usage :

char* const* ret = next(); or char* const* ret = (*next)();

0

精彩评论

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