You can declare a variable of a structure type on the stack. For instance:
But how do you initialize it? This is where the C++ member selection (.) operator comes in. It allows you to get or set the member variable values:
TapeElement.Operator = '+'; TapeElement.Operand = 234; char Operator = TapeElement.Operator;
You can see that a well-chosen structure variable name makes this read more clearly.
It is also possible to create arrays of structures:
This enables you to select member variables from any element:
TapeElement.Operator = '+'; TapeElement.Operand = 234;