http://www.perlmonks.org?node_id=555722


in reply to How is perl able to handle the null byte?

C does not treat the null byte as the end of a string unless it is told to do so by the variable length string datatype - an array of char is not zero terminated and a pointer to char has no termination at all. In C you can even assign a pointer to char to the address of the first character of your variable length string in order to betray it by walking ad libitum off the end until the operating system detects an access violation - its why strong typing isn't as safe as its cracked out to be.

-M

Free your mind

  • Comment on Re: How is perl able to handle the null byte?