client.firstName[0] = '\0' ;
client.lastName[0] = '\0' ;
will solve your problem. That's because, the string is an array of chars in C
, which is as long as it doesn't encounters a \0
character. Now, if you will make the first char = '\0'
, then the string would end there itself.