53

Two strings walk into a bar and sit down. The bartender says, “So what’ll it be?”

The first string says, “I think I’ll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy~~owmc63^Dz x.xvcu”

“Please excuse my friend,” the second string says, “He isn’t null-terminated."

Comments
  • 1
    Is this a C thing, where there is always a 0 at the end of the string? And because there is no 0, the String reads also data from other memory space? Did I get it right?
  • 1
    @binop yup that's right.
    Once I was so close to loosing a contest coz I declared 2 strings like
    char * c = {'a','b'}
    char * b = {'c','d'}

    and the string c was leaking into b....
Add Comment