Nov 19, 2013 at 8:56am UTC
Hello everyone,
i'm new to this forum. Trying to master the c++.
Here's my first question:
How can i create a bidimensional array that contain both integer and string?
Assuming i want to create the following
myArray [100][6]
where the first colum of the array contains only numbers, while the second one contains a maximum of 6 descriptions for every elements?
Thank you in advance
Nov 19, 2013 at 10:40am UTC
Thank you both.
I tried and it works nicely.
Now, assuming i wan to put the descriptions for every elements, when i want, during the execution, would be a good idea to create a class for this?
Thank you
Nov 19, 2013 at 11:41am UTC
what do you mean by "put the descriptions"? Do you mean get at them, or set them?
Nov 19, 2013 at 12:25pm UTC
Well, there's a lot in common between a struct and a class, as far as I'm aware the only significant difference is the default of public for a struct and private for a class, so converting from a struct to a class is pretty much a non-issue.
Nov 19, 2013 at 1:18pm UTC
@mutexe
I would like to initialize the descriptions one for all items, then be able to set/get any items of the array of struct.