0

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).

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Radical Edward
0

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.

0

> 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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.