This is making a lot more sense, and I get how to I should use map now.
Type: Posts; User: SnakeJam
This is making a lot more sense, and I get how to I should use map now.
In the 8th line did you mean string temp_building or building temp_building;
Never mind, you didn't.
Anyways, that looks like what I want to d. I take it that map[building_name] is the...
Could you give me a simple example using map because I don't really know much about it. Not an entire program, just how to declare an object the way I want using map (if it is in fact that...
I guess I might not be very clear about what I want to do because I don't really know how to explain it. basically I want to be able to make objects without knowing they are going to be created...
So lets say I declared 4 objects of BUILDING in the actual program code. That would work for the text file I have, but what if the text file had 5 names in it. Like this:
/* buildings.txt */...
So the structure needs to be something like this:
struct BUILDING
{
int size;
string object_name;
//rest of stuff
};
I need a way to simply declare an object based off what a text file says. For example, a text file could have the following contents:
/* buildings.txt */
house1
house2
cabin1
house3
After...