[ create a new paste ] login | about

Link: http://codepad.org/ReB7ePO8    [ raw code | output | fork | 2 comments ]

RogerPate - C++, pasted on Oct 19:
1
2
3
4
5
6
7
8
9
10
11
void f(int);
void f(int const) {/*implements above function, not an overload*/}

typedef void C(int const);
typedef void NC(int);
NC *nc = &f;  // nc is a function pointer
C *c = nc;  // C and NC are identical types



int main() { puts("Success!"); }


Output:
1
Success!


Create a new paste based on this one


Comments:
posted by RogerPate on Oct 19
reply
posted by RogerPate on Oct 19
reply