Using aggregates

Aggregates (arrays, strings, or structures) are mapped differently by C++ and COBOL and are not automatically mapped. You must completely declare every byte in the structure to ensure that the layouts of structures passed between the two languages map to one another correctly. The XL C++ compile-time option AGGREGATE and the COBOL compiler option MAP provide a layout of structures to help you perform the mapping.

In C++, a structure is simply a class declared with the struct keyword; its members and base classes are public by default. A C++ class is the same as a C++ structure if the only data is public. If a C++ class that uses features unavailable to COBOL (such as virtual functions, virtual base classes, private data, protected data, static data members, or inheritance) is passed to a COBOL program, the results are undefined.