Admin Production ni-theme
Current Publication

StrDup

LabWindows/CVI

StrDup

char *StrDup (const char stringToDuplicate[]);

Purpose

Allocates and returns a copy of a string. The caller must dispose of the string using the free function.

Parameters

Input
Name Type Description
stringToDuplicate const char[] Pass the string to be duplicated.

Return Value

Name Type Description
duplicatedString char * Returns a pointer to a newly allocated memory block containing a copy of the stringToDuplicate. If there is not enough memory to copy the string or if stringToDuplicate is passed a value of zero, then a value of zero is returned.

Additional Information

Library: Programmer's Toolbox

Include file: toolbox\toolbox.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Example

Refer to toolbox\menudemo.cws for an example of using the StrDup function.