void main(){
char check[10];
check[0] = 'a';
check[1] = 'b';
check[2] = 0;
printf("%s\n",check);
}
will produce the same output as :
void main(){
char check[10];
check[0] = 'a';
check[1] = 'b';
check[2] = '\0';
printf("%s\n",check);
}
since ascii code of '\0' is 0,
whereas ascii code of '0' is 48.
No comments:
Post a Comment