Hi
I have a function where if the first character of a string is whitespace it then deletes it.
My problem is I am getting an error on a certain line & I have no idea why & how to fix it.
error:
C++ forbids comparison between pointer and integer
Function:
void delete_whitespace(string array[], int array_size)
{
for (int i = 0; i < array_size; i++)
{
if ( array[i][0] == " " ) // This is the line where the error occurs
{
array[i].erase(0,1);
}
}
}