Reputation: 9326
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())
{
}
Upvotes: 0
Views: 1033
Reputation: 596156
Assuming you are using the std:string
class, it's clear()
method has a void
return type. You cannot use it in a boolean expression like you are attempting to.
EDIT
Link for you string clear method
Upvotes: 1