I'm trying to figure out how to know if there is a space in a string. Since in lecture it was said that in C a blank is "\0", I figured that comparing the array item with it could work.
For example, if I would like to know if a string starts with a blank, I'm trying out this code:
string name = GetString(); if (name[0] != '\0'){ printf("The string starts with a blank space\n"); }
It compiles, but it doesn't work. What's the problem with this statement: (name[0] != '\0')?
Thank you.