So, I have a string* which I used for a dynamic array. But when I try to use a string method on it, I get the error Expression must have type bool.
For Instance, I get the error when I try to do it on this piece of code
while((!board[i].clear())
{
}
Assuming you are using the
std:stringclass, it’sclear()method has avoidreturn type. You cannot use it in a boolean expression like you are attempting to.EDIT
Link for you string clear method