question about multi arrays
how do you make a multidimentional array that has...lets say a column of strings and a column of integers?
thanks, Rubiks14
well that sucks...guess i'll have to use if statements
thanks anyway...saved me some stress :D
thanks anyway...saved me some stress :D
Quote:Original post by Rubiks14
how do you make a multidimentional array that has...lets say a column of strings and a column of integers?
thanks, Rubiks14
Just how do you want to interact with this array? A std::map<...> might be what you're looking for, but I'd need more details to help more.
ok i'm wanting to set up a multidimensional array that has in column 1 what the item is and in column 2 what the price of that item is (i'm just making kind of like a market for rpg just for some practice)
P.S. i'm also just wanting to use something that is in the area of what all i know. i just got through reading chap 3 in Beginning C++ Game Programming so basically the extint of my knowledge is multidimensional arrays
P.S. i'm also just wanting to use something that is in the area of what all i know. i just got through reading chap 3 in Beginning C++ Game Programming so basically the extint of my knowledge is multidimensional arrays
Sounds like what you want is:
struct rpg_item{ std::string item; int cost;};std::vector< rpg_item > item_list;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement