Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

Storing fields in a Array

I have six fields having a list of values or records.
How can i store these values in a single array ,so that for
a particular index i should get the entire row...values of six fields
for a particular index.
Is STL provides collection classes for storing numerous fields..?
0
kallzz
Asked:
kallzz
1 Solution
 
Jaime OlivaresCommented:
You can create vector of vectors:

typedef vector<string> TRecord;

vector<TRecord> allData;



Or, if you have a fixed record structure just create a struct:

typedef struct {
   string text1;
   string text2;
   int numeric1;
   int numeric2;
   float currency1;
   float currency2;
} TRecord;

vector<TRecord> allData;

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now