I have a structure:
struct Vehicle
{
char ad;
string license;
int arrival;
};
I want to keep all the values in the structure on the stack.
I can save one value on the stack by doing:
stack<string> stack;
Vehicle v;
stack.push(v.license);
How can I save the entire structure on the stack in order to subsequently access char, int and string?
source
share