Your problem is that your if statements are using a single equals sign, which is known as 'gets' in C/C++ because it assigns a value to a variable. For comparison operations, you need to use two equals signs.
For example:
1 2 3 4
|
if(foo == bar)
{
//Do something
}
|
A few other pointers (No pun intended) to help make you a better coder:
All of your functions are of type 'int,' and they return zero when they end, even when they don't necessitate a return type. For functions of this nature, simply declare the return type as 'void' rather than 'int' and don't return anything.
1 2 3 4
|
void fooBar()
{
//Do something
}
|
The system("clear") command is system specific. It will only work on Unix based operating system which know what the "clear" command is, so it's bad practice to use it. Such an instruction completely breaks the portability of your code. (Not a big deal for that project, but in the future you'll want to keep things like this in mind.)
Lastly, please use code tags when posting code in the forums. It makes your code a lot easier to read, which increases your chances of getting help.
Cheers.