abc.cpp
#include
using namespace std;
class MY
{
public:
void MY::print()
{
cout<<"sdjflsdj"<<endl;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
MY my;
my.print();
return 0;
}
g++ abc.cpp
abc.cpp:9: error: extra qualification ‘MY::’ on member ‘print’
去掉MY::编译通过