Manipulating character strings

When character data is accepted or returned using MQI C++ methods, the character data is always null-terminated and can be of any length. However, certain limits are imposed by WebSphere MQ that might result in information being truncated. To ease storage management, character data is often returned in ImqString class objects. These objects can be cast to char * using the conversion operator provided, and used for read-only purposes in many situations where a char * is required.

Note:
The char * conversion result from an ImqString class object might be null.

Although C functions can be used on the char *, there are special methods of the ImqString class that are preferable; operator length( ) is the equivalent of strlen and storage( ) indicates the memory allocated for the character data.