The declaration int (*p[5])() means what?

int (*p[5])();

Whats the use of p?
Explain with an example or reference.
With an example.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <typeinfo>

int main()
{
    typedef int function_type() ;
    typedef function_type* pointer_type ;
    typedef pointer_type array_type[5] ;

    array_type a ;

    int (*p[5])() ;

    std::cout << "both a and b are of the same type: " << std::boolalpha
              << ( typeid(a) == typeid(p) ) << '\n' ;
}

Topic archived. No new replies allowed.