no operator "==" matching this operand
VS express 2013 Desktop
1 2 3 4 5 6 7 8 9 10 11 12
|
if (choicegamemode == 1) // first line that has error
{
//code
}
else if (choicegamemode == 2) // second line with error
{
//code
}
else
{
//code
}
|
I have:
1 2 3 4 5 6 7 8 9 10
|
#include <iostream>
#include <string>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <dos.h>
#include <windows.h>
|
I tried only having "=" but then i get: Expression must have a bool type.
Last edited on
Could you please provide a small example of code that recreates this error? You havent even shown us what "choicegamemode" is.
1 2 3 4 5 6 7 8 9
|
std::string choicegamemode;
//lots of code
std::cout << "How many people are playing?" << endl;
std::cin >> choicegamemode;
if (choicegamemode == 1)
|
Last edited on