Hi I have a text file which is supposed to be data for a new game item to be created it looks like this:
1 Sword 5 10
2 Bow 5 10
3 Axe 5 10
4 Shield 5 10
5 Spear 5 10
I know how to read each individual piece separated by space and store them into variables, but what if I wanted to use more than 1 word for the name, like "Big Sword", or "Heavy Bow", and store that as a single string.
Right now for each line I'm using
file >> id >> name >> value >> value
But is there a way to make it so that when it gets to the "name" part, I can specify how many words it will store into a single string, and also can it be done with a flexible amount of words like "Big sword" or "Big Rusty Sword" or "Big Rusty Heavy Sword" and it would still know that's one big name.
I haven't come up with any ideas yet