so basically I was doing a program on a game called chinciro and I need help because whenever I run the program it displays a runtime error which says that my variable "turn" ( bool turn;) is being used but not initialized so here is my code:
<code>
int main()
{
for (int roundcntr = 1; roundcntr < 11; roundcntr++)
{
cout << "Welcome to our base where we play undeground chinchiro" << endl;
cout << "Round " << roundcntr << " of " << 10 << endl;
int perica = 90000;
int bet;
Roll dice = rollDice();
Roll pissr = rollDice();
// things to consider when function is in use
int value1;
int value2;
bool snakeeyes1 = true;
bool snakeeyes2 = true;
bool triple1 = true;
bool triple2 = true;
bool pisser1 = true;
bool pisser2 = true;
bool turn = true;
bool roll4561 = true;
bool roll4562 = true;
bool pairs1 = true;
bool pairs2 = true;
int valuet1;
int valuet2;
bool roll1231 = true;
bool roll1232 = true;
This clearly is not your entire code. turn is defined and initialized at line 23, so the problem must be elsewhere.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
Pet peeve:
1 2 3 4 5 6
if (turn == true)
{ // some code
}
elseif (turn == false)
{ // some other code/
}
There is NO reason to have if (turn == false)
If a bool is not true, then it only be false. Only the else is needed. No reason to test again.