Just need some help - Best way to describe is with an example.
Im making a program that asks the user for 2 inputs.
at the moment it checks if input 1 = something and if input 2 = something ( if (a=blah && b=chah) ... ) and then I have another if loop below that doing the same thing but checking if they equal something else.
However when I run my program it only does the first if loop and if I type the inputs to match the second if loop it just ends the program without me even seeing the ouput (even though I have system(pause) ).
First of all, don't use system calls... they're evil. Use this instead:
1 2 3
cin.sync();
cout << "Press any key to continue...";
cin.get();
That will pause the console just like system("PAUSE"), except it's portable.
Second, can you post your full code here? The reason the IF statement is not executing might be that you are not entering the correct input, or not comparing it correctly.
Also, I noticed a few anomolies in your sample code:
a=blah
var1 = var2 is an assignment statement, NOT a comparison. If you want a comparison (which you do), it should be: a==blah.
Finally post some code so we can see what were dealing with. Make sure 'they're inside "code blocks". [ code ] your code [ /code ] (without the spaces).