cfunc.convert C Function/C Functions

cfunc.convert

Command cfunc.convert C Function/C Functions
Applicable release versions: AP 6.1
Category C Functions (120)
Description equivalent to the Pick/BASIC statement: convert string1 to string2 in result

This function returns -1 if an error occurs. The error code is contained in _CP_errno.
Syntax int _CP_convert(CPSTR** result, CPSTR* string1, CPSTR* string2)
Options
Example
/* The following example prints "bbc". */

CPSTR * s = _CP_mkstr("a");
CPSTR * t = _CP_mkstr("b");
CPSTR * u = _CP_mkstr("abc");

_CP_unix_env();
_CP_convert(&u,s,t);
_CP_TERM(u);
printf("%sn",_CP_SADDR(u));
Purpose
Related cfunc.introduction