Click here to Skip to main content
15,886,798 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Why this error happens? How to resolve this ? (Repost : Modified, now the error is different) Pin
Stuart Dootson17-Apr-09 3:12
professionalStuart Dootson17-Apr-09 3:12 
QuestionRegistry access problem Pin
Mogaambo17-Apr-09 2:08
Mogaambo17-Apr-09 2:08 
AnswerRe: Registry access problem Pin
Jijo.Raj17-Apr-09 2:14
Jijo.Raj17-Apr-09 2:14 
GeneralRe: Registry access problem Pin
Mogaambo17-Apr-09 2:19
Mogaambo17-Apr-09 2:19 
GeneralRe: Registry access problem Pin
Mogaambo17-Apr-09 2:27
Mogaambo17-Apr-09 2:27 
GeneralRe: Registry access problem Pin
Cedric Moonen17-Apr-09 2:31
Cedric Moonen17-Apr-09 2:31 
Question[DirectX9.0]How to retrive vector from Camera setting's View Matrix Pin
kallol kumar17-Apr-09 2:04
kallol kumar17-Apr-09 2:04 
QuestionA question about Assert function Pin
Obsidianhom17-Apr-09 1:10
Obsidianhom17-Apr-09 1:10 
Hi,
I know Assert function can raise a break in Debug mode. It helps a lot.

but when it is in Release mode,the Compile ignore Aseert function. then how can I know it meets a error?

for example:

int open_file(char * filename)
{
FILE *fp;
fp=fopen(filename,"wr"); //p1
assert(fp!=NULL); //p2

//do something
//p3
}

in Debug mode:
when p1 fail, fp will be NULL and the assert will raise a break,then it exit.

in Release mode:
the Compile ignore the assert function, what should I do if fopen failed?
if it will go on running statements after p3 ?

to avoid this happend, should I have to replace all the assert statements in Release mode?

thank you.
AnswerRe: A question about Assert function Pin
Cedric Moonen17-Apr-09 1:14
Cedric Moonen17-Apr-09 1:14 
GeneralRe: A question about Assert function Pin
China_Kevin17-Apr-09 2:58
China_Kevin17-Apr-09 2:58 
GeneralRe: A question about Assert function Pin
Cedric Moonen17-Apr-09 3:00
Cedric Moonen17-Apr-09 3:00 
GeneralRe: A question about Assert function Pin
China_Kevin17-Apr-09 3:26
China_Kevin17-Apr-09 3:26 
GeneralRe: A question about Assert function Pin
China_Kevin17-Apr-09 3:33
China_Kevin17-Apr-09 3:33 
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 
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 

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.