|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (5 bit)
Join Date: Dec 2001
Posts: 17
|
If function
Hi,
Could anyone explain to me the following code? if(acquire(),NULL) { return true; } where acquire() is just a user-defined function. Why is it the 'if' function can contain two parameters? Thank you. |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
First you have to tell us which programming language you are using.
|
|
|
|
|
|
#3 |
|
Member (5 bit)
Join Date: Dec 2001
Posts: 17
|
Hi,
I'm using C programming. |
|
|
|
|
|
#4 |
|
Member (7 bit)
Join Date: Mar 2002
Location: Florida's Economy Sucks?
Posts: 74
|
Hola xgirl
The way I understand the IF statement is: IF(expression) statement Where expression is, you would have the the expression being evaluated. Where statement is you would have the instruction to execute. If the expression returns True, then the statement is executed. i.e x=100 If(x==100) cout << "x is 100"; If you have multiple lines of code to execute then: if(x==100) { cout <<"The value of x is "; cout<< x ; } You can have multiple expressions evaluated: if(x==100 || x==0) { cout<<"The value of x is"; cout<< x ; } If x is 100 or 0 the code will be executed. Hope that helps jd Last edited by j0hn d0e; 03-25-2002 at 06:59 AM. |
|
|
|
|
|
#5 | |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|