hi thx again
but why copy constructor can not be overloaded
where my class have char *
for example
is copy *text to *text and delete contain of textCode:class A{/// "class A" as "class CString" char* text; Public: A() { text = new char[100]; } A(A& in) { text = new char[strlen(in.text)+1]; strcpy(text,in.text); } ~A() { if(text != NULL) delete [] text; } }; A Operator =(A _Aout,A _Ain) { strcpy(_Ain.text,_Aout.text); } /////////////////////////////////////////////////// A fun() { A temp; return temp;<<<<<<<<<<<<<< call copy constructor and ~A and delete text(if not implement copy constructor) } void main() { A tempin = fun();<<<<<<<<<< strcpy NULL A(if not implement copy constructor) }
or what is solution in this problem?????
NOTE: is build success in debug but has error in build in release
ERROR: cannot overloaded



Reply With Quote

