Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is #if 1 1

Status
Not open for further replies.

fox12

Programmer
Jan 18, 2005
62
US
Hi, Gurus,

I only have basic understanding of C language. In a program, I have the following code segment that I don't understand:

#if 1
close_transaction();
#else
exec_transaction();
#endif

My question is what the line "#if 1" mean, and from where I should look to find the control whether it is "1" or "0".

Do appreciate your help on this.

Fox12
 
#if 1 is badly written code which someone is (or was) debugging.

0 = false
Everything else = true

So the #if 1 block will always be executed and the #else will never be executed.
 
Thank you so much. It's very helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top