Click here to Skip to main content
15,879,077 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can generate Max. Combination of given Value? Pin
Le@rner4-Apr-10 21:24
Le@rner4-Apr-10 21:24 
GeneralRe: How can generate Max. Combination of given Value? Pin
Adam Roderick J4-Apr-10 21:35
Adam Roderick J4-Apr-10 21:35 
GeneralRe: How can generate Max. Combination of given Value? Pin
Le@rner4-Apr-10 21:39
Le@rner4-Apr-10 21:39 
GeneralRe: How can generate Max. Combination of given Value? Pin
CPallini5-Apr-10 0:11
mveCPallini5-Apr-10 0:11 
Questioncombinations repetition allowed Pin
MsmVc4-Apr-10 19:33
MsmVc4-Apr-10 19:33 
AnswerRe: combinations repetition allowed Pin
CPallini5-Apr-10 0:13
mveCPallini5-Apr-10 0:13 
QuestionCString multiple assignment leak? Pin
TechAvtar4-Apr-10 19:12
TechAvtar4-Apr-10 19:12 
AnswerRe: CString multiple assignment leak? [modified] PinPopular
LunaticFringe4-Apr-10 19:30
LunaticFringe4-Apr-10 19:30 
TechAvtar wrote:
What will happen to the memory allocated for "hello"? Will it be released at assignment of "world"?


Yes. The current content of a CString variable will be automatically released when the variable goes out of scope, as well.

[edit]

Would someone like to explain why this has been 1-voted? The answer is correct. There may be some hedging involved as to whether new memory is actually allocated depending on the length of the two strings, as Joe pointed out, but the point is the reassignment of the variable will not result in a leak.

THAT was the question.

I assume the individual who voted it a 1 will now present some proof indicating that a leak WILL occur, justifying the 1?


[/edit]
L u n a t i c F r i n g e

AnswerRe: CString multiple assignment leak? Pin
Adam Roderick J4-Apr-10 20:15
Adam Roderick J4-Apr-10 20:15 
GeneralRe: CString multiple assignment leak? Pin
TechAvtar4-Apr-10 21:35
TechAvtar4-Apr-10 21:35 
GeneralRe: CString multiple assignment leak? PinPopular
Adam Roderick J4-Apr-10 21:40
Adam Roderick J4-Apr-10 21:40 
AnswerRe: CString multiple assignment leak? Pin
Joe Woodbury5-Apr-10 6:41
professionalJoe Woodbury5-Apr-10 6:41 
QuestionSecond Window in Win32 Pin
Fareed Rizkalla4-Apr-10 14:51
Fareed Rizkalla4-Apr-10 14:51 
AnswerRe: Second Window in Win32 Pin
enhzflep4-Apr-10 15:09
enhzflep4-Apr-10 15:09 
GeneralRe: Second Window in Win32 Pin
Fareed Rizkalla4-Apr-10 20:53
Fareed Rizkalla4-Apr-10 20:53 
GeneralRe: Second Window in Win32 Pin
enhzflep5-Apr-10 1:59
enhzflep5-Apr-10 1:59 
GeneralRe: Second Window in Win32 Pin
Fareed Rizkalla5-Apr-10 3:51
Fareed Rizkalla5-Apr-10 3:51 
GeneralRe: Second Window in Win32 Pin
enhzflep5-Apr-10 8:36
enhzflep5-Apr-10 8:36 
QuestionRe: Second Window in Win32 Pin
Fareed Rizkalla5-Apr-10 15:41
Fareed Rizkalla5-Apr-10 15:41 
AnswerRe: Second Window in Win32 Pin
enhzflep6-Apr-10 2:12
enhzflep6-Apr-10 2:12 
GeneralRe: Second Window in Win32 Pin
Fareed Rizkalla6-Apr-10 5:13
Fareed Rizkalla6-Apr-10 5:13 
GeneralRe: Second Window in Win32 Pin
enhzflep6-Apr-10 17:42
enhzflep6-Apr-10 17:42 
GeneralRe: Second Window in Win32 Pin
Fareed Rizkalla5-Apr-10 16:28
Fareed Rizkalla5-Apr-10 16:28 
AnswerRe: Second Window in Win32 Pin
Garth J Lancaster4-Apr-10 15:11
professionalGarth J Lancaster4-Apr-10 15:11 
Questionsocket programming in c help Pin
kedah4-Apr-10 8:48
kedah4-Apr-10 8:48 

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.