Manipulating binary strings in C++

Strings of binary data are declared as objects of the ImqBinary class. Objects of this class can be copied, compared, and set using the familiar C operators. Example code is provided.

The following code sample shows operations on a binary string:
#include <imqi.hpp> // C++ classes

ImqMessage message ;
ImqBinary id, correlationId ;
MQBYTE24 byteId ;

correlationId.set( byteId, sizeof( byteId ) ); // Set.
id = message.id( );                            // Assign.
if ( correlationId == id ) {                   // Compare.
...
Parent topic: C++ language considerations