: int main(){
: Demo<myClass> d;
: myClass *mptr = 0;
: //我该如何使用 Demo 类别的 Assigment 和 Accessors 呢?
: cout << *d <<endl; //error
: d = *mptr; //error
: d.operator*(mptr); //error
: }
: 感谢指教...
感谢板友的指教
的确应该是 d = mptr
int main(){
Demo<myClass> d;
myClass *mptr;
//我该如何使用 Demo 类别的 Assigment 和 Accessors 呢?
d = mptr; //讯息如下
}
C:\Users\USER\AppData\Local\Temp\ccEmgiM2.o Untitled1.cpp:(.text+0x25):
undefined reference to `Demo<myClass>::operator=(myClass*)'
C:\Users\USER\Desktop\collect2.exe [Error] ld returned 1 exit status