I am writing a program that will evalute a string and check for spaces, when I try to compile it I get this error message:
Error 1 error C2446: '==' : no conversion from 'const char *' to 'int' c:\documents and settings\brett\my documents\visual studio 2008\projects\project1\ai learn algorithm\ai learn algorithm\test.cpp 12
what is wrong, and how can I fix it
all help is appreciated,
Brett
getline(cin, teststr);
int counter = 0;
cout << teststr[counter];
if (teststr[counter] == " "){
cout << "test complete";
}
Error 1 error C2446: '==' : no conversion from 'const char *' to 'int' c:\documents and settings\brett\my documents\visual studio 2008\projects\project1\ai learn algorithm\ai learn algorithm\test.cpp 12
what is wrong, and how can I fix it
all help is appreciated,
Brett
getline(cin, teststr);
int counter = 0;
cout << teststr[counter];
if (teststr[counter] == " "){
cout << "test complete";
}
