strcpy

when used like this:
strcpy(buf, buf1);
strcpy(buf + length, tempBuf);

How does the "length" part of this work ? I know that this will join the two string together in buf, but I don't understand how 'length' come in play.

Thanks

The first line says, "put buf1 at the location of buf." The second line says "put tempBuf at the location (buf + length)." Assuming that buf1 has a length of "length", you know the location of (buf + length) is the end of buf1.
Topic archived. No new replies allowed.