What order do they work in. For example, if I entered the following code, how will it execute?
if (arArray[iC][1] == 0 || arArray[1][iB] == 0 && iC < 5 && iB < 5)
When it reads the code, does it read it as:
1. arArray[iC][1] == 0 or arArray[1][iB] == 0 must hold true and iC < 5 and iC < 5...
I was wondering if I could use continue in a nested if statement to rerun the statement if something is held true.
Ex.
if (iC = 0)
{
}
else if (iC = 1)
{
}
else if (iC = 2)
{
continue
}
Could I use the continue to reloop the entire if statement?
This is because when the computer is unable to literally randomize. When the computer randomizes, it prints from a sequence of numbers. As a result, everytime the program is run, it selects from the same list so the same sequence is given.
When using the rand() % number(or variable); command...
I'm trying to send a dourble array to another function, but I can't figure out how.
ex.
How would I send an array named Array[5][5] to another function?
Thanks in advance.
I'm looking for the syntax to change the color of text in MS-Dos. For example:
cout << "Example" << endl;
How could I output it in color?
Thanks in advance.
Problem #1:
I can't too seem to figure out how the (Sleep command) timing in C++ works. For example:
cout << "Hi" << endl;
Sleep(1000);
cout << "Hi again" << endl;
Sleep(1000);
cout << "Hi for the second time" << endl;
When I run this, the timing is missaligned...
All variables used are declared as 0
siProbability = ((3 - siPlayerHits) / (25 - siPlayerShots) * 100);
cout << " Probability of Winning: " << siProbability << "%" << endl;
Oddly enough, everytime I run the program, the value that I get is 0%. I know for certain...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.