1

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 pointer to a const pointer to a char, but I'm still a bit confused. If someone could answer this ASAP that would be great!

1
  • It can help reading the signature right to left. Especially with "strange" pointers as this. Commented May 18, 2011 at 9:43

2 Answers 2

5

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

Sign up to request clarification or add additional context in comments.

1 Comment

Give a man a fishing pole and he can read the most horrendously complicated type declarations conceivable.
2

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)();

1 Comment

takes an unspecified number of arguments; not "no arguments"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.