T_STRDUP duplicate a string
dest
pointer to use for duplicate
src
string to be duplicated
None
None
T_STRDUP is a macro that makes a copy of a string. The duplicated string should be freed with T_FREE when it is no longer needed.
T_STRDUP evaluates its arguments twice, so do not use ++ or -- in the arguments. For example, the results of T_STRDUP(
dest_ptr
++, --
src_ptr
)
are undefined.
T_MALLOC, T_CALLOC, T_REALLOC, T_FREE
This example duplicates a string:
TIBCO SmartSockets™ Utilities Software Release 6.7, June 2005 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |