C++ Programming Question: Download Questions PDF
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
![C++ Programming Interview Answer C++ Programming Interview Question](https://globalguideline.com/public/images/interview/24.png)
Answer:
Answer1
If you want the code to be even slightly readable, you will use typedefs.
typedef char* (*functiontype_one)(void);
typedef functiontype_one (*functiontype_two)(void);
functiontype_two myarray[N]; //assuming N is a const integral
Answer2
char* (* (*a[N])())()
Here a is that array. And according to question no function will not take any parameter value.
If you want the code to be even slightly readable, you will use typedefs.
typedef char* (*functiontype_one)(void);
typedef functiontype_one (*functiontype_two)(void);
functiontype_two myarray[N]; //assuming N is a const integral
Answer2
char* (* (*a[N])())()
Here a is that array. And according to question no function will not take any parameter value.
Download C++ Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
What is the auto keyword good for in C++? | What does extern mean in a function declaration in C++? |