Saturday, May 22, 2010

C++ question 10 POINTS COMIN YOUR WAY!?

is there a way to write a command like:





do


{


//stuff here


}while(variable != char)





is there a way to something like that??


i want to do a set of commands if the variable is char NOT int


please help!


code:





if(userNumber == 0, 40000000)


{


cout %26lt;%26lt; userNumber %26lt;%26lt; " is my favorite number too!" %26lt;%26lt; endl;


system("pause");


return 0;


}


do


{


int userNumber;


cout %26lt;%26lt; "Hey! That's not a real number. Please enter your favorite number and then press enter." %26lt;%26lt; endl;


cin %26gt;%26gt; userNumber;


system("pause");


do


{


cout %26lt;%26lt; userNumber %26lt;%26lt; " is my favorite number too!" %26lt;%26lt; endl;


system("pause");


return 0;


}while(userNumber == 0, 40000000);





}while(char);


}








i conjured this out of no where LOL


this isn't similiar to my code but it sort of is


(i changed sentences variables and removed other code as well)


thanks in advance

C++ question 10 POINTS COMIN YOUR WAY!?
I'll try this code.. then I'll tell you something!

apple

No comments:

Post a Comment