_CP_SADDR

_CP_SADDR returns a standard char* pointing to the first character of the string buffer within a CPSTR structure. Because _CP_SADDR is a macro, it can be used either to the left or right side of an assignment operator.

Syntax

char* _CP_SADDR(CPSTR* string)
Note: The char* that _CP_SADDR returns is not necessarily null-terminated.

Example(s)

CPSTR * s = _CP_mkstr("hi");
_CP_SADDR(s)[1] = ’o’;    /* replace 2nd character */
_CP_unix_env();           /* UNIX print environment */
_CP_TERM(s);              /* null terminate */
printf("%s\n",_CP_SADDR(s));