NWSMCopyString

Copies a specified number of characters to a buffer.

Syntax

  #include <smsutapi.h> 
   
  STRING NWSMCopyString ( 
     STRING_BUFFER **dest, 
     void             *src, 
     INT16             srcLen);
  

Parameters

dest

(OUT) Points to the buffer to receive the copied string.

src

(IN) Points to the string to copy.

srcLen

(IN) Specifies the length of src.

Return Values

The following table lists the return values associated with the function.

NULL

Cannot copy the strings.

Nonzero

The strings are copied and the pointer points to dest.string.

Remarks

NOTE:This function is supported only for backward compatibility, the NWSMCopyGenericString function can be used instead of this, as it provides the same functionality.

To free the string, call NWSMFreeString.

If dest is NULL, NWSMCopyString allocates memory for the string. If dest.string is too small to contain the concatenated strings, NWSMCopyString frees the memory and allocates a new structure with more memory.

If srcLen is set to -1, NWSMCopyString calculates the length of src.

See Also

NWSMFreeString

NWSMCopyString Example

  #include <smsutapi.h> 
   
  STRING resultString; 
  STRING_BUFFER *dest = NULL; 
  char *src = “string”; 
  INT16 srcLen = sizeof(src);  
   
  resultString = NWSMCopyString(&dest, src, srcLen);