SDDSlib
|
Implementation of string manipulation functions. More...
#include "mdb.h"
Go to the source code of this file.
Functions | |
char * | cp_str (char **s, char *t) |
Copies a string, allocating memory for storage. | |
char * | cpn_str (char **s, char *t, long n) |
Copies a specified number of characters from a string. | |
Implementation of string manipulation functions.
Definition in file cp_str.c.
char * cp_str | ( | char ** | s, |
char * | t ) |
Copies a string, allocating memory for storage.
This function duplicates the input string t
by allocating sufficient memory and copying its contents. If t
is NULL
, the destination pointer s
is set to NULL
.
s | Pointer to the destination string pointer. |
t | Source string to be copied. |
NULL
if t
is NULL
. Definition at line 28 of file cp_str.c.
char * cpn_str | ( | char ** | s, |
char * | t, | ||
long | n ) |
Copies a specified number of characters from a string.
This function duplicates the first n
characters of the input string t
by allocating sufficient memory and copying the specified number of characters. The copied string is null-terminated. If t
is NULL
, the destination pointer s
is set to NULL
.
s | Pointer to the destination string pointer. |
t | Source string from which to copy characters. |
n | Number of characters to copy. |
n
characters, or NULL
if t
is NULL
. Definition at line 50 of file cp_str.c.