Click here to Skip to main content
15,915,834 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Memory allocation Pin
Dennis L12-Aug-08 4:29
Dennis L12-Aug-08 4:29 
QuestionRe: Memory allocation Pin
David Crow12-Aug-08 4:36
David Crow12-Aug-08 4:36 
AnswerRe: Memory allocation Pin
Dennis L12-Aug-08 4:52
Dennis L12-Aug-08 4:52 
GeneralRe: Memory allocation Pin
David Crow12-Aug-08 5:18
David Crow12-Aug-08 5:18 
GeneralRe: Memory allocation Pin
Dennis L12-Aug-08 5:22
Dennis L12-Aug-08 5:22 
AnswerRe: Memory allocation Pin
Roger Stoltz12-Aug-08 4:41
Roger Stoltz12-Aug-08 4:41 
AnswerRe: Memory allocation Pin
sashoalm12-Aug-08 4:48
sashoalm12-Aug-08 4:48 
AnswerRe: Memory allocation Pin
Bram van Kampen12-Aug-08 9:03
Bram van Kampen12-Aug-08 9:03 
Well, what's being missed is that s0,s1 and s2 are char Arrays of 1,2 and 1 byte respectively, and NOT poiners! Why are they being displayed as DWORD.
What byte packing is used. Unless if you have a constructor SOME(), in which you specifically initialise the structure, you should not rely on the content of the structure because it is unpredictable.

The DEBUG version of the compiler tries to pad uninitialised and deleted structures with garbage in an attempt to make your code blow if you by mistake forget to initialise, or attempt to refer to de-allocated data.

The Release version is by no means as friendly, in that it does none of these things. If your code works while referring to data outside their validity scope, you create a timebomb which at some time in the future will cause unpredictable and mysterious crashes. I note that you read the structure after deallocation, This mere read could lead to an invalid memory access crash. (ever tried to read a NULL pointer?)

Regards, Smile | :)

Bram van Kampen

QuestionC++: How to declare constant array of pointers of TCHAR Pin
akirilov12-Aug-08 3:46
akirilov12-Aug-08 3:46 
AnswerRe: C++: How to declare constant array of pointers of TCHAR Pin
toxcct12-Aug-08 3:56
toxcct12-Aug-08 3:56 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
akirilov12-Aug-08 4:27
akirilov12-Aug-08 4:27 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
toxcct12-Aug-08 4:38
toxcct12-Aug-08 4:38 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
akirilov12-Aug-08 5:08
akirilov12-Aug-08 5:08 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
toxcct12-Aug-08 5:12
toxcct12-Aug-08 5:12 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
David Crow12-Aug-08 5:30
David Crow12-Aug-08 5:30 
QuestionAppilication hang during DB down Pin
krishnan.s12-Aug-08 3:32
krishnan.s12-Aug-08 3:32 
QuestionSemi-transparent drawing Pin
Nuri Ismail12-Aug-08 3:28
Nuri Ismail12-Aug-08 3:28 
AnswerRe: Semi-transparent drawing Pin
Mark Salsbery12-Aug-08 4:41
Mark Salsbery12-Aug-08 4:41 
GeneralRe: Semi-transparent drawing Pin
Nuri Ismail12-Aug-08 4:49
Nuri Ismail12-Aug-08 4:49 
AnswerRe: Semi-transparent drawing Pin
vikas amin12-Aug-08 5:00
vikas amin12-Aug-08 5:00 
QuestionWSAStartup generates unhandled exception Pin
jimjim73312-Aug-08 2:51
jimjim73312-Aug-08 2:51 
AnswerRe: WSAStartup generates unhandled exception Pin
Jijo.Raj12-Aug-08 3:14
Jijo.Raj12-Aug-08 3:14 
AnswerRe: WSAStartup generates unhandled exception Pin
David Crow12-Aug-08 3:58
David Crow12-Aug-08 3:58 
GeneralRe: WSAStartup generates unhandled exception Pin
jimjim73312-Aug-08 4:07
jimjim73312-Aug-08 4:07 
QuestionRe: WSAStartup generates unhandled exception Pin
Mark Salsbery12-Aug-08 4:51
Mark Salsbery12-Aug-08 4:51 

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.