by stoopdapoop on Sat Feb 04, 2012 1:52 pm
You've declared InventoryList as a local variable, which I'm pretty sure is not what you actually want to do. Once the function reaches it's end the vector will go away. You want to declare it as a member variable, outside of a function. That way it'll exist as long as the object exists in memory. This is a big issue, but not the reason why it's not compiling
CInventory isn't an object, you're trying to call a method on a class which doesn't work unless it's static. CreateInventory() is not a static method, you could fix your compile error by making it so, but you'd need to use the "::" operator to call it, not the "." operator.
Also, your second function doesn't have a name. CON_COMMAND is the return type, and you've (partially) listed two parameters but you've failed to declare their types. I'm not exactly sure what you're trying to do with that section of code because it doesn't really look like C++.
Moral of the story is that there are quite a few things wrong with this (probably more than I listed).
If you want to want to post a more specific description of what you want to do then I'd be willing to help in a more detailed way. Sounds like you just want to get it to compile, but even if you get it to compile it won't be doing what you think it is.
I'm Brown
