Query: stracat
OS: debian
Section: 3pub
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
STRACAT(3pub) C Programmer's Manual STRACAT(3pub)NAMEstracat - concatenate many strings into an allocated memory blockSYNOPSIS#include <publib.h> char *stracat(const char *s, ...);DESCRIPTIONstracat will allocate a block of memory with malloc and concatenate all arguments strings into this block. The user is supposed to free the returned block. The end of the argument list is signalled by a null pointer.RETURN VALUEstracat returns a pointer to the allocated block, or NULL if it could not be allocated.EXAMPLETo concatenate "hello, " and "world", one might say the following. p = stracat("hello, ", "world", (char *)NULL); if (p != NULL) puts(p); Please note that it is necessary to case NULL as in the example above, since there is no information about the type of the argument available in the prototype, and since an unadorned NULL might not be of the correct type. (See any good C reference book or the comp.lang.c FAQ for more information.)SEE ALSOpublib(3), strcat(3)AUTHORLars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual STRACAT(3pub)