an if statement that has two variables
i am working in c++ and i need to make an if statement that says if a and b are equivelent to 0 then...
the only way that I could think of was if (a==0) (b==0) {... } this however does not work. thanks for all your help! |
Code:
if ( (a==0) && (b==0) ) Code:
if ( (!a) && (!b) ) I'd really discourage you from putting code after your start ("{") brace: http://www.gnu.org/prep/standards/ http://geosoft.no/development/cppstyle.html http://www.chris-lott.org/resources/cstyle/ etc etc ad nauseum... PPS: Here are the two variants you'll see most often: I'd choose one of these: Code:
// K & R, Java: Code:
// ANSI C/C++, .Net: |
All times are GMT -5. The time now is 06:12 PM. |