esoteric C stuff, what is "debug_flag"??

S

syn1kk

So I have this code that allocates memory for a struct, by the name of
"instance[tuner]", and then it checks to see if the allocation was
successful -->

if( instance[tuner] == NULL )
{
send_tuner_to_user(tuner) ;
send_string_to_user("ERR:could not malloc instance\r\n") ;
debug_flag |= DFLAG__HEAP_FULL ;
return FALSE ;
}


1.) I was just curious, what is this debug_flag?

2.) How do people customarily use this debug flag thing?

3.) Do they use it similiar to how a C++ exception is used??
 
W

Walter Roberson

syn1kk said:
debug_flag |= DFLAG__HEAP_FULL ;
1.) I was just curious, what is this debug_flag?

A program-specific variable, probably of either file scope or
global scope.

2.) How do people customarily use this debug flag thing?

They don't. The flag is specific to the program, not a standard
C facility.

3.) Do they use it similiar to how a C++ exception is used??

No.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top