| _CP_str_alloc | Index Level | _CP_str_free |
| Syntax | CPSTR * _CP_str_copy(CPSTR * string) |
| Category | C Interface |
| Type | C Function |
| Description | makes a copy of a CPSTR. The actual contents of the string are copied rather than just the pointer. |
| Options | |
| See Also | C Functions introduction |
| Example |
CPSTR * s = _CP_mkstr("Null value");
CPSTR * a[20]; int i; for (i = 0; i < 20; i++) a[i] = _CP_str_copy(s); This example assigns the string "Null value" to all the elements of the array "a". Note that copies are necessary so that each element can be modified without affecting the others. |
| Warnings | |
| Compatibility | AP 6.1 |
| _CP_str_alloc | Index Level | _CP_str_free |