//The following 2 functions setup
//the players inventory and allows the
//player to view it.
int bag_space = 10; //Sets up a maximum bag space for the player
vector <string> inventory(bag_space); //Initialize the array containing the players inventory
void init_inventory(){
for (int x = 0; x < bag_space; x++){
inventory[x].push_back("Empty");}
}
void view_inventory(){
for (int x = 0; x < bag_space; x++){
cout << x + 1 << " - " << inventory[x] << endl;}
}
It returns the following error message:
[Error] invalid conversion from 'const char*' to 'char' [-fpermissive]
Can anyone please help? :( Please say so if I'm not giving sufficient information.
Edit: Nevermind. I changed inventory[x].push_back("Empty"); to inventory[x] = "Empty"; and it works just fine :).