cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
strcpy
strcpy
Aug 1, 2013 at 11:20pm UTC
nmn
(47)
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
Aug 1, 2013 at 11:41pm UTC
Zhuge
(4664)
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.