Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using multidimensional arrays

Status
Not open for further replies.

tewari68

Programmer
Jan 25, 2005
87
0
0
US
Hi,
Can someone guide me to some tutorial for creating and accessing multidimensional arrays.
I have to create a multidimensional array for storing foldernames, folderoptions and optionvalues.
There will be several folders with different names and each folder might have one or more folderoptions and each folderoption will have optionvalue of n or y.
After creating the multidimensional array I will have to access the folderoptions and values for that options corresponding to a given foldername.

Thanks,
tewari
 
Did you search for +"multidimensional arrays" +"C++" on Google?

You should also look at the vector class in the STL. It's better than an array since it grows automagically as you add more data to the end of the vector.

A better C++ approach to the problem is probably something like this:
Code:
class FolderOption
{
public:
   // Constructors, Set & Get functions...

private:
   string  m_OptionName;
   bool    m_OptionValue;
};

class Folder
{
public:
   // Constructors, Set & Get functions...

private:
   string                m_FolderName;
   vector<FolderOption>  m_FolderOptions;
};

vector<Folder>  folders;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top