i have a string "8120, 8120NGE, 8120NG, 8130, 8130NG, 8130NGE"
.
And i have a char*
(0x0012d094 "8130")
I want to see if the "8130" is in. That exact word.
So i am using
istringstream iss(boards);
string token;
AVBOOL foundBool=FALSE;
while(std::getline(iss, token, ','))
{
const char * compareToken = token.c_str();
token.compare(board); // with that : it doesn't work cause "8130" is not equal 0x0012d094 "8130"
if(strcmp(compareToken,board)==0) //with that it doesnt work cause 0x0012cef0 " 8130" is not equal 0x0012d094 "8130"
{
foundBool=TRUE;
}
}
So the question is how do i compare a string with a char * .
Do I need to convert the char into a string and then use string.compare OR Do i need to convert the string into a char and use strcmp? OR Do i need to do something else?
I am kind of lost here.