Category : C Source Code
Archive   : CSRC2.ZIP
Filename : CPYSTR.C

Output of file : CPYSTR.C contained in archive : CSRC2.ZIP
* c p y s t r . c



title cpystr String Copy
index String copy

char *
cpystr(out, in);
char *out;
char *in;

Copy "in" to "out". Return a pointer to the end of out.
This allows the following usage:

char *ptr;
char buffer[BUFSIZ];
extern char *cpystr();
ptr = cpystr(buffer, text);
ptr = cpystr(ptr, more_text);

The above sequence appends more_text to the copy of text
already moved into the buffer.


cpystr is not present on other C libraries.


#define EOS 0

char *
cpystr(out, in)
register char *out;
register char *in;
* Copy in to out, return &out[strlen(in)]
while ((*out++ = *in++) != EOS)
return (out - 1);

  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : CPYSTR.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: