Problem with my coding?

For my coding assignment I had to write a function that would create the outline of a board for a Mancala game. I thought I had finished writing it but no matter what I do I get the Left Operand must be l-value error along with the expression must be a modifiable lvalue. The problem occurs on line 96 or if (int i = 0||i = 7). I have looked in my book and online for answers but I can't figure out the problem with my code. Any help or advice would be greatly appreciated.

using namespace std;
int stars;
int main()
{
{
void showBoard();
}
return 0;
}
void showBoard()
{
void makeSolidLine();
cout << endl;
{
for (int i = 1; i < 12; i += 1)
{
if (i = 6)
{
cout << "* 13 ";
void makeSolidLine();
cout << " 6 *\n";
}
else if (i = 3)
{
void showTopRowNumbers();
cout << endl;
}
else if (i = 9)
{
void showBottomRowNumbers();
cout << endl;
}
else
{
void makeDottedLine();
cout << endl;
}
}
}
void makeSolidLine();
cout << endl;
}
void makeSolidLine()
{
for (int i = 0; i < stars; i += 1);
{
cout << "*";
}
}
void makeDottedLine()
{
for (int i = 1; i < 10; i += 1);
{
cout << "*";
for (int j = 1; j < 7; j += 1);
{
cout << " ";
}
}
}
void showTopRowNumbers()
{
for (int i = 0; i < 9; i += 1);
{
if (int i = 0||i == 7)
{
cout << "*";
cout << setw(6);
cout << " ";
cout << setw(0);
}
else
{
cout << "*";
cout << setw(4);
if (i != 8)
{
cout << " ";
cout << setw(0);
}
}
}
}
void showBottomRowNumbers()
{
for (int i = 12; i > 3; i -= 1);
{
if (int i = 0||i = 7)
{
cout << "*";
cout << setw(6);
cout << " ";
cout << setw(0);
}
else
{
cout << "*";
cout << setw(4);
if (i != 6)
{
cout << " ";
cout << setw(0);
}
}
}
}
Last edited on
Hi, it might be easier to turn your code into "code format" - simply select the code portion of the text and hit the '<>' in the Format area.

This should display it in code format and make it easier for us to read :)
= is assignment. == is comparison. So if (i = 6) should be if (i == 6) etc. Also int i defines a new variable. To get the value of an existing variable i, just use i. So if (int i = 0||i = 7) should be if (i == 0||i == 7)
Topic archived. No new replies allowed.