Click here to Skip to main content
15,908,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C string operations Pin
Richard MacCutchan13-May-16 6:43
mveRichard MacCutchan13-May-16 6:43 
GeneralRe: C string operations Pin
Member 1256233616-Jun-16 12:40
Member 1256233616-Jun-16 12:40 
GeneralRe: C string operations Pin
Richard MacCutchan16-Jun-16 22:10
mveRichard MacCutchan16-Jun-16 22:10 
AnswerRe: C string operations Pin
Patrice T14-May-16 3:05
mvePatrice T14-May-16 3:05 
AnswerRe: C string operations Pin
CPallini14-May-16 3:06
mveCPallini14-May-16 3:06 
AnswerRe: C string operations Pin
leon de boer14-May-16 5:58
leon de boer14-May-16 5:58 
QuestionC execl is this a bug ? Pin
Member 1096409913-May-16 5:37
Member 1096409913-May-16 5:37 
GeneralRe: C execl is this a bug ? Pin
Richard MacCutchan13-May-16 6:07
mveRichard MacCutchan13-May-16 6:07 
AnswerRe: C execl is this a bug ? Pin
k505413-May-16 9:56
mvek505413-May-16 9:56 
AnswerRe: C execl is this a bug ? Pin
leon de boer14-May-16 5:44
leon de boer14-May-16 5:44 
QuestionWindows 7 UAC prevents my app to write log data Pin
sdancer7510-May-16 8:25
sdancer7510-May-16 8:25 
AnswerRe: Windows 7 UAC prevents my app to write log data PinPopular
Richard Deeming10-May-16 9:11
mveRichard Deeming10-May-16 9:11 
GeneralRe: Windows 7 UAC prevents my app to write log data Pin
sdancer7511-May-16 3:33
sdancer7511-May-16 3:33 
GeneralRe: Windows 7 UAC prevents my app to write log data Pin
Richard Deeming11-May-16 4:31
mveRichard Deeming11-May-16 4:31 
GeneralRe: Windows 7 UAC prevents my app to write log data Pin
sdancer7511-May-16 6:17
sdancer7511-May-16 6:17 
Question0xC000041D: An unhandled exception was encountered during a user callback. Pin
Austin Donaghy6-May-16 12:49
Austin Donaghy6-May-16 12:49 
AnswerRe: 0xC000041D: An unhandled exception was encountered during a user callback. Pin
Richard MacCutchan6-May-16 22:42
mveRichard MacCutchan6-May-16 22:42 
GeneralRe: 0xC000041D: An unhandled exception was encountered during a user callback. Pin
Austin Donaghy7-May-16 0:09
Austin Donaghy7-May-16 0:09 
AnswerRe: 0xC000041D: An unhandled exception was encountered during a user callback. Pin
Jochen Arndt6-May-16 23:01
professionalJochen Arndt6-May-16 23:01 
GeneralRe: 0xC000041D: An unhandled exception was encountered during a user callback. Pin
Austin Donaghy7-May-16 0:08
Austin Donaghy7-May-16 0:08 
AnswerRe: 0xC000041D: An unhandled exception was encountered during a user callback. Pin
Victor Nijegorodov7-May-16 20:48
Victor Nijegorodov7-May-16 20:48 
AnswerRe: 0xC000041D: An unhandled exception was encountered during a user callback. Pin
leon de boer8-May-16 3:36
leon de boer8-May-16 3:36 
99% of the time if you get a difference between release and debug mode you forgot to zero a variable and assume it is.

Turn the warning levels up to full and you should get a warning saying "use of uninitialized variable".

Usually it is something like this
int Bad (int someval){
	int i;
	if (someval > 0){
		i = 1;
	}
	if (i == 0) return (1);
	return (0);
}

In debug mode all local variables are zeroed automatically. That simply doesn't happen in release mode the variables will start at whatever rubbish was in the stack at the position it was allocated.

In the above code the behaviour of "bad" is totally predictable in debug mode as "i" will always start at 0. In release mode you have no idea what is going to happen as "i" could start at any value and the return is purely chance based.

Look carefully at the code, now try compiling it and tell me if you get a warning Smile | :)
In vino veritas


modified 8-May-16 9:48am.

Questionis there any good book about c++ class? Pin
hakan826-May-16 1:07
hakan826-May-16 1:07 
AnswerRe: is there any good book about c++ class? Pin
Richard MacCutchan6-May-16 2:57
mveRichard MacCutchan6-May-16 2:57 
AnswerRe: is there any good book about c++ class? Pin
CPallini9-May-16 21:31
mveCPallini9-May-16 21:31 

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.