Hello,
I have the following code segments:
and then I have a class member/method like this:Code:CString fooA = TEXT(""); CString fooB = TEXT("");
Code:CString* pStr; // this is a pointer to my CString; void Constructor(CString* str){ // Constructor of my class this->pStr = str; } void doSomething(){ //Member method of my class *(this->pStr) = TEXT("FOO"); }
When I pass '&fooA' to the constructor of my class and execute 'doSomething' somewhen, the content of 'fooB' changes? How can this be? Every variable in my whole program which has TEXT("") assigned to it changes it's content to "FOO" - did I change TEXT("")'s content??? please help
kind regards,
Michael




Reply With Quote