Mail Archives: djgpp/1997/09/06/12:33:18
Andrew Deren (aderen AT eecs DOT uic DOT edu) writes:
> But where are you going to copy it to?
> mid3 is just a pointer pointint somewhere to your memory. if you want
> to use strncpy you first have to allocate memory for mid3.
Setting mid3=mystring+4 points mid3 at memory just past mystring. This
will work for strcat/strcpy so long as mystring is itself allocated,
points to a zero-terminated string and has 4 or more characters (so the
null is at or past mid3). So will strncat and strncpy, since they copy UP
TO 'n' characters, less if they find a null first.
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -