cfunc.saddr
Return a pointer to the first character of a CPSTR*
Syntax
char* _CP_SADDR(CPSTR* string)
Description
returns a standard char* pointing to the first character of the string buffer within a CPSTR structure.
Because _CP_SADDR is a macro, it may be used either on the left-hand or the right-hand side of an assignment operator.
Example
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));
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
