Click here to Skip to main content
15,867,849 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: A question about Assert function Pin
Rajesh R Subramanian17-Apr-09 3:36
professionalRajesh R Subramanian17-Apr-09 3:36 
GeneralRe: A question about Assert function Pin
China_Kevin17-Apr-09 3:44
China_Kevin17-Apr-09 3:44 
JokeRe: A question about Assert function Pin
David Crow17-Apr-09 5:00
David Crow17-Apr-09 5:00 
JokeRe: A question about Assert function Pin
China_Kevin17-Apr-09 15:00
China_Kevin17-Apr-09 15:00 
GeneralRe: A question about Assert function Pin
dandanfeng16017-Apr-09 15:56
dandanfeng16017-Apr-09 15:56 
GeneralRe: A question about Assert function Pin
Obsidianhom17-Apr-09 3:54
Obsidianhom17-Apr-09 3:54 
GeneralRe: A question about Assert function Pin
China_Kevin17-Apr-09 4:14
China_Kevin17-Apr-09 4:14 
AnswerRe: A question about Assert function [modified] Pin
Luc Pattyn17-Apr-09 1:53
sitebuilderLuc Pattyn17-Apr-09 1:53 
I concur with Cédric.
Use assert to discover logic flaws in your program while debugging, don't use it to detect exceptional circumstances, things that go wrong not because there is an error in your program, but because the circumstances are against you, as in a missing file. Hence:

// EDIT
#define null NULL
// /EDIT

if (fp==null) {
    // whatever needs to happen when the file won't open
} else {
    // whatever you want to do with the file
}


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


modified on Friday, April 17, 2009 2:59 PM

JokePlease Pin
CPallini17-Apr-09 2:02
mveCPallini17-Apr-09 2:02 
GeneralRe: Please Pin
Luc Pattyn17-Apr-09 2:05
sitebuilderLuc Pattyn17-Apr-09 2:05 
JokeRe: Please Pin
CPallini17-Apr-09 2:15
mveCPallini17-Apr-09 2:15 
GeneralRe: Please Pin
Rajesh R Subramanian17-Apr-09 2:35
professionalRajesh R Subramanian17-Apr-09 2:35 
Questionwin32 exe memory usage issue Pin
Ash_VCPP17-Apr-09 1:06
Ash_VCPP17-Apr-09 1:06 
AnswerRe: win32 exe memory usage issue Pin
Obsidianhom17-Apr-09 1:14
Obsidianhom17-Apr-09 1:14 
GeneralRe: win32 exe memory usage issue Pin
Ash_VCPP17-Apr-09 1:49
Ash_VCPP17-Apr-09 1:49 
GeneralRe: win32 exe memory usage issue Pin
Rolf Kristensen18-Apr-09 0:46
Rolf Kristensen18-Apr-09 0:46 
AnswerRe: win32 exe memory usage issue Pin
_AnsHUMAN_ 17-Apr-09 1:36
_AnsHUMAN_ 17-Apr-09 1:36 
GeneralRe: win32 exe memory usage issue Pin
Ash_VCPP17-Apr-09 2:29
Ash_VCPP17-Apr-09 2:29 
QuestionRe: win32 exe memory usage issue Pin
Rajesh R Subramanian17-Apr-09 1:45
professionalRajesh R Subramanian17-Apr-09 1:45 
AnswerRe: win32 exe memory usage issue Pin
Ash_VCPP17-Apr-09 1:51
Ash_VCPP17-Apr-09 1:51 
GeneralRe: win32 exe memory usage issue Pin
Luc Pattyn17-Apr-09 1:57
sitebuilderLuc Pattyn17-Apr-09 1:57 
GeneralRe: win32 exe memory usage issue Pin
Ash_VCPP17-Apr-09 2:01
Ash_VCPP17-Apr-09 2:01 
AnswerRe: win32 exe memory usage issue Pin
Rajesh R Subramanian17-Apr-09 2:27
professionalRajesh R Subramanian17-Apr-09 2:27 
AnswerRe: win32 exe memory usage issue Pin
China_Kevin17-Apr-09 2:39
China_Kevin17-Apr-09 2:39 
Questionduration of AAC audio Pin
yuanfen13917-Apr-09 0:55
yuanfen13917-Apr-09 0:55 

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.