#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string codigo = "12345678917";
int remainder = 7;
if (remainder == codigo[10]) {
cout<<"equal" << endl;
}
return 0;
}
It's just a simple comparison. This code doesnt print "equal".
I changed the type of the int to char or string but it didnt work. I tried comparison methods and still nothing. Am missing something here?
It did work when i changed remainder to '7'. But idk why comparing with variable doesnt work