Hi all,
I am a newbie, trying to create a list using STL. I need the list to be made up of structs. I can use a list made up of strings, ints, etc. But don't know the syntax for insert with a struct. What I have written is incomplete, but it's here:
#include <iostream>
#include <string>
#include <list>
#include <algorithm>
using namespace std;
struct proc
{
int RTime;
int STime;
int ATime;
};
int main()
{
list <string> fruits;
fruits.insert(fruits.begin(),"Apples"
;
//How to make list with structs as members?
}
Thanks,
Sheila
I am a newbie, trying to create a list using STL. I need the list to be made up of structs. I can use a list made up of strings, ints, etc. But don't know the syntax for insert with a struct. What I have written is incomplete, but it's here:
#include <iostream>
#include <string>
#include <list>
#include <algorithm>
using namespace std;
struct proc
{
int RTime;
int STime;
int ATime;
};
int main()
{
list <string> fruits;
fruits.insert(fruits.begin(),"Apples"
//How to make list with structs as members?
}
Thanks,
Sheila