Before data can be encoded, an instance of the C++ class for a given data type must be populated. In most cases, this involves the simple assignment of data items to the elements within the structure and is very similar to the C case presented earlier. In some cases, however, dynamic memory pointers are involved. It is necessary to know how dynamic memory works in the run-time in order to populate these fields.