Click here to Skip to main content
15,922,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Stephane Rodriguez.26-Oct-02 19:45
Stephane Rodriguez.26-Oct-02 19:45 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Member 5194327-Oct-02 6:01
Member 5194327-Oct-02 6:01 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Stephane Rodriguez.27-Oct-02 7:04
Stephane Rodriguez.27-Oct-02 7:04 
GeneralRe: MSHTML Table Insertion using CHtmlEditView Pin
Member 5194327-Oct-02 9:14
Member 5194327-Oct-02 9:14 
GeneralThanks for help to includeh10 Chris Losinger Pin
Svin26-Oct-02 12:16
Svin26-Oct-02 12:16 
GeneralDword usage Pin
J. Schermerhorn26-Oct-02 12:15
J. Schermerhorn26-Oct-02 12:15 
GeneralRe: Dword usage Pin
Anders Molin26-Oct-02 12:19
professionalAnders Molin26-Oct-02 12:19 
GeneralRe: Dword usage Pin
Chris Losinger26-Oct-02 12:20
professionalChris Losinger26-Oct-02 12:20 
GeneralRe: Dword usage Pin
Paul M Watt26-Oct-02 19:39
mentorPaul M Watt26-Oct-02 19:39 
GeneralRe: Dword usage Pin
Gary R. Wheeler27-Oct-02 3:23
Gary R. Wheeler27-Oct-02 3:23 
GeneralRe: Dword usage Pin
J. Schermerhorn30-Oct-02 8:24
J. Schermerhorn30-Oct-02 8:24 
GeneralConsole Applications Pin
Cpudood26-Oct-02 11:43
Cpudood26-Oct-02 11:43 
GeneralRe: Console Applications Pin
Anders Molin26-Oct-02 12:17
professionalAnders Molin26-Oct-02 12:17 
GeneralRe: Console Applications Pin
Daniel Turini26-Oct-02 12:28
Daniel Turini26-Oct-02 12:28 
GeneralRe: Console Applications Pin
carrie26-Oct-02 13:07
carrie26-Oct-02 13:07 
GeneralCCriticalSection Pin
Anonymous26-Oct-02 10:57
Anonymous26-Oct-02 10:57 
GeneralRe: CCriticalSection Pin
Neville Franks26-Oct-02 12:09
Neville Franks26-Oct-02 12:09 
GeneralRe: CCriticalSection - volatile? Pin
26-Oct-02 13:00
suss26-Oct-02 13:00 
GeneralRe: CCriticalSection - volatile? Pin
Neville Franks26-Oct-02 13:34
Neville Franks26-Oct-02 13:34 
General10x Pin
Anonymous26-Oct-02 14:19
Anonymous26-Oct-02 14:19 
GeneralParaller Port Comunication. Pin
int01h26-Oct-02 9:12
int01h26-Oct-02 9:12 
GeneralRe: Paraller Port Comunication. Pin
Gary R. Wheeler27-Oct-02 3:56
Gary R. Wheeler27-Oct-02 3:56 
GeneralRe: Paraller Port Comunication. Pin
Daniel Strigl28-Oct-02 0:41
Daniel Strigl28-Oct-02 0:41 
GeneralOperator overloading! Help! Pin
26-Oct-02 8:43
suss26-Oct-02 8:43 
GeneralRe: Operator overloading! Help! Pin
Paul M Watt26-Oct-02 11:36
mentorPaul M Watt26-Oct-02 11:36 
I am not sure what you mean by the overload operator?

As far as the assignment operator, this is what you need to do:

1: check for a reference to the current object. There is no sense in reassigning of you are doing something like this:

Object A;
A = A;

Here is the code you use to do that check:

myString &operator=(const myString& rhs)
{
if (*this == rhs)
{
return *this;
}
...
}

2: delete all of your existing memory, to prevent memory leaks.
delete[] theString;
theString = NULL;

3: allocate and copy the data from the input parameters.
if (rhs.theString)
{
length = strlen(rhs.theString) + 1;
theString = new char[length];
strcpy(theString, rhs.theString);
}

4: Returns a reference to this object to make things like this possible:
Object A, B, C;
...
A = B= C;

Here is the code to do this:

return *this;

Good Luck


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.