-
June 28th, 2009, 07:08 PM
#1
Large Structs
I am creating a project that will allow a user to keep track of all the products that we create. I have to create a struct to keep all the data for each product we make. Here's the struct.
Code:
struct PRODUCT_DATA {
int IL;
int freq;
int serial;
int date;
bool recal;
double CorrFacVal;
double CorrFreq;
double std_diff;
double error;
double IL_d_3;
};
The problem: For each product we make, it get's it own struct worth of data. I can't declare the amount of structs that I need, it's too large to be put on the stack.
The usage: (We have around 500k worth of products that we have made and each of them needs their data stored). MyProduct[500000];
When the program is loaded up it will read from a CSV file that will input each product into it's own struct and from there I can modify any existing product, search through them to recover data about it, add more products, or delete products.
Question: Is there a better way to do this? I've looked at SQLite although that seems a bit overkill for what I am trying to do, and a bit complicated for my skill level. I just need one very large array of structs. Around a 500,000k array of these structs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|