Cannot compare pointers to strings?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
dE_logics
Messages
742
Reaction score
0
After compiling the code below, GCC says that you can't compare a pointer to string by iso C++ standards.

But I don't see a pointer anywhere (I don't know pointers for now...did it long ago, now forgot)...may be it has to do with the fact that arrays are called by reference.

Code:
char convert(unsigned char input[]);
main()
{
	unsigned char input[1000];
	convert(input);
}
char convert (unsigned char input[])
{
	int i;
	if(input[0] == " ");
}
 
Physics news on Phys.org
dE_logics said:
Code:
if(input[0] == " ");
input[0] has type unsigned char&.
" " has type const char*.

You meant ' ' which has type char.
 
Oh...damn...I meant single quotes. :P