P
Paul Williams
I've got some char arrays declared, some as
char anArray[10] ;
and some as
char aChar ;
Im trying to ensure that all are null terminated, so am using:
anArray[0] = '\0' ;
aChar[0] = '\0' ;
But the second one does not compile - I get the error:
'The array operator must have one operand that is a pointer to
acomplete type and one of integral type'
I thought that aChar[n] was equivalent to (&aChar + n)?
Obviously aChar = '\0' ; works, but is that not equivalent to
aChar[0] = '\0' ;
ta
char anArray[10] ;
and some as
char aChar ;
Im trying to ensure that all are null terminated, so am using:
anArray[0] = '\0' ;
aChar[0] = '\0' ;
But the second one does not compile - I get the error:
'The array operator must have one operand that is a pointer to
acomplete type and one of integral type'
I thought that aChar[n] was equivalent to (&aChar + n)?
Obviously aChar = '\0' ; works, but is that not equivalent to
aChar[0] = '\0' ;
ta