Function _conPutC() Foundation
Assigns a NULL terminated character string to a container or creates a string container.
ContainerHandle _conPutC(ContainerHandle ch, CHAR *pcString);
Returns the passed container handle or a newly created container handle. The return value is NULLCONTAINER if an error occurs.
Using this function, not only can a string value be assigned to an available container, but a new container can be created. When the passed container handle has the value NULLCONTAINER, a new container is created. Otherwise the value of the passed container is changed. The C string that is passed is copied into the container up to the first NULL character.
When a new container is created, it must be released with _conRelease() as soon as it is no longer needed.
/*
Creates a container of character type:
*/
#include <xppcon.h>
ContainerHandle hString;
XPPAPIRET xr;
hString = _conPutC(NULLCONTAINER,
"This is the value of the new container");
if (hString != NULLCONTAINER)
{
/* ... operations with the container */
_conRelease(hString);
}
else
{
xr = _conLastError();
/* ... error handling */
}
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.