Why *strptr = 0 truncate the string?(C)
Why the ascii value 30 of 0 become 0 of null?
More precisely, there are three lexical elements that contain a zero character:
'0' (quoted, typically (but not always) equal to
0x30 unquoted) and
'\0' (equal to
0, but in character notation).
The question is talking about two distinct values...
'0' != '\0'. Forget about 30, 48, etc. Just remember
'\0' are different characters, and
'\0' is a string terminator that has a value of
I think you meant to use
'0' (emphasis on the quotation marks).