TutStrDup copies a string
str
string to be duplicated
Pointer to the duplicate string.
None
TutStrDup makes a copy of the character string. It takes a pointer to a string as an argument and returns a pointer to the copy of that string. When the duplicate string is no longer needed, it should be disposed of with the T_FREE macro.
Failure to properly dispose of the duplicate string creates a memory leak.
This example duplicates a string:
T_CHAR strptr[80], T_STR dup_string; strcpy(strptr, "This is a duped string"); dup_string = TutStrDup(strptr); TutOut("%s\n", dup_string); . . .
The TutOut statement produces this output:
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |