cfunc.col2 C Function/C Functions

cfunc.col2

Command cfunc.col2 C Function/C Functions
Applicable release versions: AP 6.1
Category C Functions (120)
Description equivalent to the Pick/BASIC statement: "result = col2".

This function returns -1 if an error occurs. The error code is contained in _CP_errno.
Syntax int _CP_col2(int* result)
Options
Example
The following example prints "ab 2 5"

CPSTR * s = _CP_mkstr("zdabdz");
CPSTR * t = _CP_mkstr("d");
int i,j;

_CP_field(&s,s,t,2);
_CP_col2(&i);
_CP_col2(&j);
_CP_TERM(s);
_CP_unix_env();
printf("%s %d %dn",_CP_SADDR(s),i,j);
Purpose
Related cfunc.introduction