{The S-lang C Library Reference}: SLmake_string

Next Previous Contents

## 87. SLmake_string

Synopsis

  Duplicate a string

Usage

  `char *SLmake_string (char *s)`

Description

  The `SLmake_string` function creates a new copy of the string `s`, via `malloc`, and returns it. Upon failure it returns `NULL`. Since the resulting string is malloced, it should be freed when nolonger needed via a call to either `free` or `SLfree`.

Notes

  `SLmake_string` should not be confused with the function `SLang_create_slstring`, which performs a similar function.

See Also

  `SLmake_nstring, SLfree, SLmalloc, SLang_create_slstring`

Next Previous Contents