Hi,
I have to acess a vector, which is a member of a structure...
Could you please help me..
Jump to PostWell its really simple
struct student { std::string name; double midterm, final; std::vector<double> assignments; }; int main() { struct student a_student; a_student.assignments.push_back(value); return 0; }
Well its really simple
struct student
{
std::string name;
double midterm, final;
std::vector<double> assignments;
};
int main()
{
struct student a_student;
a_student.assignments.push_back(value);
return 0;
}
Hi gerard,
Thanks for the info.. But , i need to retrieve the information that has pushed. Could you please help me..
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.