Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get my IP ? Pin
Nibu babu thomas24-Apr-06 17:09
Nibu babu thomas24-Apr-06 17:09 
AnswerRe: How to get my IP ? Pin
David Crow24-Apr-06 7:36
David Crow24-Apr-06 7:36 
QuestionSelection of lengthy path in the open save dialog box, retunr truncated string Pin
Sandeep. Vaidya24-Apr-06 5:37
Sandeep. Vaidya24-Apr-06 5:37 
AnswerRe: Selection of lengthy path in the open save dialog box, retunr truncated string Pin
Nibu babu thomas24-Apr-06 17:17
Nibu babu thomas24-Apr-06 17:17 
GeneralRe: Selection of lengthy path in the open save dialog box, retunr truncated string Pin
Sandeep. Vaidya24-Apr-06 20:25
Sandeep. Vaidya24-Apr-06 20:25 
GeneralRe: Selection of lengthy path in the open save dialog box, retunr truncated string Pin
Sandeep. Vaidya25-Apr-06 0:06
Sandeep. Vaidya25-Apr-06 0:06 
GeneralRe: Selection of lengthy path in the open save dialog box, retunr truncated string Pin
Nibu babu thomas25-Apr-06 1:49
Nibu babu thomas25-Apr-06 1:49 
Questionoverride operator + Pin
ehh24-Apr-06 5:06
ehh24-Apr-06 5:06 
Hello,
I'm trying to learn about overriding operators, so i wrote a simple class, Overrider, which allocates a small instance variable (an array) in its constructor. The problem is with the + operator; if I allocate the return object on the stack, it calls the destructor at the return statement, so for the statement
Overrider a, b, c;
...
a = b + c;
the object returned by (b + c) from operator + is not valid when it gets to to the operator = for a. When I trace the call stack, the destructor is called, and the instance-variable array is deleted, before it can be copied in the = operator.
If I allocate the object on the heap, the object returned from operator + is valid in the = operator, but then there's a memory leak.
I'm clearly missing something simple; I can post the code if that'd help, or if someone has a pointer to a tutorial that shows an example of overriding + when the class allocates memory in the constructor, I'd be appreciative.
thanks,
ed

AnswerRe: override operator + Pin
Chris Losinger24-Apr-06 5:16
professionalChris Losinger24-Apr-06 5:16 
GeneralRe: override operator + Pin
ehh24-Apr-06 7:55
ehh24-Apr-06 7:55 
Questionneed help - certificates Pin
Machma24-Apr-06 5:05
Machma24-Apr-06 5:05 
QuestionMulticast Pin
Smith#24-Apr-06 4:48
Smith#24-Apr-06 4:48 
AnswerRe: Multicast Pin
Ryan Binns24-Apr-06 5:00
Ryan Binns24-Apr-06 5:00 
QuestionYour thoughts on multi-threaded client run on the same machine. Pin
deltaseq024-Apr-06 4:10
deltaseq024-Apr-06 4:10 
AnswerRe: Your thoughts on multi-threaded client run on the same machine. Pin
Moak27-Apr-06 6:53
Moak27-Apr-06 6:53 
GeneralRe: Your thoughts on multi-threaded client run on the same machine. Pin
deltaseq027-Apr-06 10:14
deltaseq027-Apr-06 10:14 
QuestionActiveX Control Pin
stassi124-Apr-06 4:09
stassi124-Apr-06 4:09 
QuestionProperty Sheets Pin
si_6924-Apr-06 4:04
si_6924-Apr-06 4:04 
QuestionRe: Property Sheets Pin
David Crow24-Apr-06 4:13
David Crow24-Apr-06 4:13 
AnswerRe: Property Sheets Pin
si_6924-Apr-06 4:19
si_6924-Apr-06 4:19 
GeneralRe: Property Sheets Pin
David Crow24-Apr-06 4:27
David Crow24-Apr-06 4:27 
GeneralRe: Property Sheets Pin
si_6924-Apr-06 4:30
si_6924-Apr-06 4:30 
GeneralRe: Property Sheets Pin
David Crow24-Apr-06 5:05
David Crow24-Apr-06 5:05 
GeneralRe: Property Sheets Pin
si_6924-Apr-06 5:07
si_6924-Apr-06 5:07 
GeneralRe: Property Sheets Pin
David Crow24-Apr-06 6:13
David Crow24-Apr-06 6:13 

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.