dividing a string into other variables
hi
this is my first post and i would really like your help
my input would be in this form
category name ! type1 quantity av_mode ! type2 quantity av_mode ! typeM quantity av_mode
i need to divide this string into variables I've created
this is what i have so far but i can not think of a way to do this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
struct type
{
string name;
int quantity;
char av_mode;
};
struct product
{
string name;
struct type type;
};
struct category
{
string name;
struct product product;
};
|
1 2
|
string input;
getline(cin, input, '!');
|
thanks in advance
Last edited on
Topic archived. No new replies allowed.