Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to make truncation in C++ Pin
Rajesh R Subramanian2-Jul-09 22:50
professionalRajesh R Subramanian2-Jul-09 22:50 
GeneralRe: How to make truncation in C++ Pin
CPallini2-Jul-09 22:56
mveCPallini2-Jul-09 22:56 
AnswerRe: How to make truncation in C++ Pin
KarstenK3-Jul-09 3:21
mveKarstenK3-Jul-09 3:21 
AnswerRe: How to make truncation in C++ Pin
Dan3-Jul-09 10:21
Dan3-Jul-09 10:21 
GeneralRe: How to make truncation in C++ Pin
Michael Schubert3-Jul-09 12:19
Michael Schubert3-Jul-09 12:19 
QuestionHow to make a LONGLONG array ? Pin
krish_kumar2-Jul-09 21:25
krish_kumar2-Jul-09 21:25 
AnswerRe: How to make a LONGLONG array ? Pin
«_Superman_»2-Jul-09 21:30
professional«_Superman_»2-Jul-09 21:30 
GeneralRe: How to make a LONGLONG array ? Pin
krish_kumar2-Jul-09 21:50
krish_kumar2-Jul-09 21:50 
QuestionGetPrivateProfileString() problem Pin
ashish8patil2-Jul-09 20:22
ashish8patil2-Jul-09 20:22 
AnswerRe: GetPrivateProfileString() problem Pin
«_Superman_»2-Jul-09 20:34
professional«_Superman_»2-Jul-09 20:34 
GeneralRe: GetPrivateProfileString() problem Pin
ashish8patil2-Jul-09 21:31
ashish8patil2-Jul-09 21:31 
QuestionSTL find errors Pin
thelonesquirrely2-Jul-09 13:34
thelonesquirrely2-Jul-09 13:34 
AnswerRe: STL find errors Pin
«_Superman_»2-Jul-09 16:49
professional«_Superman_»2-Jul-09 16:49 
GeneralRe: STL find errors Pin
CPallini2-Jul-09 20:48
mveCPallini2-Jul-09 20:48 
GeneralRe: STL find errors Pin
«_Superman_»2-Jul-09 21:35
professional«_Superman_»2-Jul-09 21:35 
QuestionQuestion about some code that should crash but does not (release vs. debug & VS2003 vs. VS2008) Pin
Maximilien2-Jul-09 9:23
Maximilien2-Jul-09 9:23 
AnswerRe: Question about some code that should crash but does not (release vs. debug & VS2003 vs. VS2008) Pin
Stuart Dootson2-Jul-09 10:32
professionalStuart Dootson2-Jul-09 10:32 
GeneralRe: Question about some code that should crash but does not (release vs. debug & VS2003 vs. VS2008) Pin
Maximilien2-Jul-09 12:57
Maximilien2-Jul-09 12:57 
AnswerRe: Question about some code that should crash but does not (release vs. debug & VS2003 vs. VS2008) Pin
Christopher W. Smith2-Jul-09 20:39
Christopher W. Smith2-Jul-09 20:39 
I think you are assuming that a struct in C++ works the same way as a struct in plain old C, but alas it doesn't... well not really anyway.

When you introduce non-primitive data types into structs in C++ they cease to be simple "data structures" and become basically the same as classes only their members default to public instead of private.

My guess is when you try to overwrite the object you are writing over the beginning of its virtual table which probably contains extra debug information in debug mode. In release mode you are then probably overwriting more important class data.

Remember, the sizeof operator is not designed to get the size of an object or its virtual table.

http://en.wikipedia.org/wiki/Virtual_method_table[^]

Chris Smith

GeneralRe: Question about some code that should crash but does not (release vs. debug & VS2003 vs. VS2008) Pin
Maximilien3-Jul-09 1:04
Maximilien3-Jul-09 1:04 
Questionhow can i get file names dynamically? Pin
santhosh-padamatinti2-Jul-09 8:50
santhosh-padamatinti2-Jul-09 8:50 
QuestionRe: how can i get file names dynamically? Pin
Rajesh R Subramanian2-Jul-09 9:24
professionalRajesh R Subramanian2-Jul-09 9:24 
AnswerRe: how can i get file names dynamically? Pin
Stuart Dootson2-Jul-09 9:32
professionalStuart Dootson2-Jul-09 9:32 
AnswerRe: how can i get file names dynamically? Pin
Madhu Nair2-Jul-09 18:27
Madhu Nair2-Jul-09 18:27 
GeneralRe: how can i get file names dynamically? Pin
Stuart Dootson2-Jul-09 20:34
professionalStuart Dootson2-Jul-09 20:34 

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.