[ create a new paste ] login | about

Link: http://codepad.org/o2FHd2eM    [ raw code | output | fork ]

C++, pasted on Jul 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
using namespace std;

void a(){cout<<"a"<<endl;}
void b(){cout<<"b"<<endl;}
void c(){cout<<"c"<<endl;}
void (*funPtrsArray[])() = {a, b, c};//ошибка "a brace-enclosed initializer is not allowed here before '{' token"
                      //ISO C++ forbids initialization of member 'funPtrsArray'

int main(){
    funPtrsArray[1]();
    return 0;
}


Output:
1
b


Create a new paste based on this one


Comments: