declare vector of a struct in function cpp code example
Example: how to store a struct in vector in c++
struct subject
{
string name;
int marks;
int credits;
};
vector<subject> sub;
struct subject
{
string name;
int marks;
int credits;
};
vector<subject> sub;