S
salmonella
Hi,
I'm trying to print on screen an address of class member function (the
function of certain object of course). My code looks like this:
class MyClass
{
public:
void fun(void){};
};
void (MyClass::*ptr)(void);
void main(void)
{
MyClass myObject;
ptr = MyClass::fun;
cout << myObject.*ptr << endl;
// ...
}
An error occures while compilation:
"fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp',
line 2701) Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information"
My questions are:
1. Why I got this error?
2. How should I do it (print address) properly?
TIA
I'm trying to print on screen an address of class member function (the
function of certain object of course). My code looks like this:
class MyClass
{
public:
void fun(void){};
};
void (MyClass::*ptr)(void);
void main(void)
{
MyClass myObject;
ptr = MyClass::fun;
cout << myObject.*ptr << endl;
// ...
}
An error occures while compilation:
"fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp',
line 2701) Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information"
My questions are:
1. Why I got this error?
2. How should I do it (print address) properly?
TIA