Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

null bytes (was Re: C vs perl)

by mandog (Curate)
on Apr 29, 2002 at 02:19 UTC ( [id://162743]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: C vs perl
in thread C vs perl

I'm probably missing something but...

>man strcat
[snip] DESCRIPTION The strcat() function appends a copy of the string pointed to by the s2 parameter (including the terminating null byte) to the end of the string pointed to by the s1 parameter. The initial byte of s2 overwrites the null byte at the end of the string pointed to by s1. When operating on overlapping strings, the behavior of this function is unreliable.

How does strcat know where to append the second string w/o a null byte in string 1 ?



email: mandog

Replies are listed 'Best First'.
Re: null bytes (was Re: C vs perl)
by abstracts (Hermit) on Apr 29, 2002 at 02:25 UTC
    Sorry, my apologies. I was thinking of strcpy (as opposed to strcat) when I replied. You're absolutely correct.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://162743]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found