Stack structure

Hi there,

Is there any way to add stack a structure with puch command? I have some information like name sirname age school etc which user enters and I want them to push on a stack one by one. I know the way for one name or one age but what about hole stuck?

Thanks in advance!
Use a constructor
eg:
1
2
3
4
5
6
7
struct Info
{
    string name;
    unsigned age;
    Info( string Name, unsigned Age ): age(Age), name(Name){}
};
mystack.push( Info("Name",123) );
Topic archived. No new replies allowed.