1. does operator `new' throw anything on failure?
2. I have a function which gives a pointer to function (e.g. void (*)(int) ) as its parameter. know I want to call the function with the proper pointer function as argument, but its method of a class. g++ gives me error on this action. See the example:
Code:
void Func (void (*F)(int)) {
F (3);
}
class CTest {
public:
void PrintNum (int);
};
CTest::PrintNum (int k) {
printf ("The number is %d\n", k);
}
main () {
CTest Test;
Func (Test.PrintNum (13)); // ERROR :(
}
Also I used whatever casting I could (C-style, reinterpret_cast, static_cast,...) but all of them give me error.