Data structures describe the data related to a cluster object and are used as
the building blocks of value lists. The data structures follow the following
example:
Allocation of a Data Structure
To allocate a data structure on the frame, define the structure variable as
follows:
struct MyStructType { int topScore;};
void SomeFunc(void)
{ // Frame allocation
MyStructType myStruct;
// Use the struct
myStruct.topScore = 297;
// Reclaimed when exiting scope }
The memory occupied by the structure is reclaimed when it exits the scope.
To allocate data structures on the heap:
Use new to allocate data structures on the heap and delete to free them, as
shown by the following example:
// Heap allocation MyStructType* myStruct = new MyStructType; // Use the structure through the pointer ... myStruct->topScore= 297; delete myStruct;