Welcome! Log In Create A New Profile

Advanced

Multiply buttons pressed

Posted by maarten66 
Multiply buttons pressed
April 07, 2009 09:18AM
I am working on a simple homebrew program for training my little skills:P but i have a problem. When the - button and the B button are pressed my program have to go to the Menu_Page void. I thougt the code should be something like this, but this gave me an error. Can someone explain me the code as it should be?
if (buttons & WPAD_BUTTON_MINUS)
and (buttons & WPAD_BUTTON_B)
     Menu_Page();



Edited 1 time(s). Last edit at 04/07/2009 09:18AM by maarten66.
Re: Multiply buttons pressed
April 07, 2009 10:57AM
Try taking on some slightly less challenging programs before programming for the Wii.

Your problem is solved like this:
if(condition1 && condition2)
Re: Multiply buttons pressed
April 07, 2009 01:13PM
it works:D thank you so very much
Re: Multiply buttons pressed
April 07, 2009 11:02PM
Here are a couple other symbols as well that you may need to use when programming if statements in C/C++:

And: &&
Or: ||
Is equal too: ==
Is not equal to: !=
Sorry, only registered users may post in this forum.

Click here to login