I am creating a simple terminal fantasy game using C++. I have seemed to run into an error "error: variable-sized object 'items' may not be initialized". Here is the code:
string useItem(int item)
{
string items[item] = {"HP Potion","Attack Potion","Defense Potion","Revive","Paralize Cure"};
}
I want to be able to use this function in order to access and return an item. How can I fix this error. I am using Code::Blocks with mingw compiler.