[ create a new paste ] login | about

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

C++, pasted on Feb 14:
#include <iostream>

class ClassA {

    ClassA() {}
    ~ClassA() {}

    int foo1();
    int foo2(void*);

};

int ClassA::foo2(void* data) {
        return 0;
}

int foo3(int(*)(void*), void*) {
        return 0;
}

int ClassA::foo1() {
    int err;
    err=foo3(foo2,NULL);
    return err;
}

int main()
{
        std::cout << foo1() << std::endl;
        return 0;
}


Output:
1
2
3
t.cpp: In member function 'int ClassA::foo1()':
Line 23: error: argument of type 'int (ClassA::)(void*)' does not match 'int (*)(void*)'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: