Hello everyone,

I have this project where I have to convert a declaration into English word.

If it reads this line(assume no spaces are used)
void*(*z) (char, int (*)());

my output would be.
z is a pointer to a function that takes 2 parameters a char and a pointer to a function that takes no parameters and returns an int and returns a pointer to void.

only variable z is in each function.

Can anyone suggest a way to start this?
Of course I have to locate z first. I don't need code, just some ideas on how to start.
Thanks. (Trying not to use STL).

Recommended Answers

All 2 Replies

Why not use the STL? Is this schoolwork?

Either way, I still don't understand what you are trying to do with that function pointer. But the best place to get your head around it is to take a read through The Function Pointer Tutorials.

Hope this helps.

> Can anyone suggest a way to start this?
Do you know anything about recursive descent parsing? That would be Ed's first stop, because declarations can be nested as parameters, and handling of that comes with recursive descent. You can also search for source code of programs called "decl", they usually do the same thing as your project and can give you ideas of how to go about it. Here's one that Ed found right away.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.