PLEASE HELP STUPID ISSUE HERE
hey im having an annoyin dev c++ issue. here is my extremely basic code, dw bout context:
im trying to get it to output the char but it wont run.
when my code was like this:
without the value for the char, it ran but only printed out the first letter, because its a char. but when i put it like this:
i get the error:
ISO C++ forbids comparison between pointer and integer
please help.
Code:
#include <iostream>
#include <cmath>
#include <windows.h>
char a[100];
int main(){
using namespace std;
cin >> a;
if (a == 'si')
{
cout << a <<" is 'Yes'"<<endl;
}
else if (a == 'hh'){
cout <<"baf"<<endl;
}
else if (a == 'hfs'){
cout <<"fgy"<<endl;
}
else
{
cout <<"fua"<<endl;
}
system ("pause");
return 0;
}
when my code was like this:
Code:
char a;
Code:
char a[100];
ISO C++ forbids comparison between pointer and integer
please help.
