I have a spare parts shop. My supplier gave me his huge database of product references (unsigned int).

I want to be able to enter the product reference # on my computer and immediately get the corresponding list of item codes & serial numbers for that product.

Each product reference can have unlimited item codes (by group of 3 char - no string please!) & serial numbers (unsigned int) SEE BELOW

My level of C++ is weak, however I know how to read a comma separated raw file and load it into static arrays.

The problem is that some products only have 1 item code + 1 serial number, and others have more than 1000!

So I need to create dynamic arrays (vectors ?) (otherwise I would need to buy 2048GB of RAM!!!)

What is the simplest way?


Examples :

Reference #16732 has 4 item codes and 4 serial numbers:
Reference #116840 has 1 item code and 1 serial number:
Reference #169699400 has 2 item codes and 2 serial numbers:

itemCode[16732][0][0]='1' itemCode[16732][0][1]='2' itemCode[16732][0][2]='U' serialNum[16732][0]=454562
itemCode[16732][1][0]='U' itemCode[16732][1][1]='4' itemCode[16732][1][2]='Z' serialNum[16732][1]=65465
itemCode[16732][2][0]='M' itemCode[16732][2][1]='6' itemCode[16732][2][2]='A' serialNum[16732][2]=189456
itemCode[16732][3][0]='Z' itemCode[16732][3][1]='P' itemCode[16732][3][2]='Y' serialNum[16732][3]=894461

itemCode[116840][0][0]='U' itemCode[116840][0][1]='P' itemCode[116840][0][2]='1' serialNum[116840][0]=65465

itemCode[169699400][0][0]='T' itemCode[169699400][0][1]='5' itemCode[169699400][0][2]='B' serialNum[169699400][0]=848947
itemCode[169699400][1][0]='7' itemCode[169699400][1][1]='Y' itemCode[169699400][1][2]='N' serialNum[169699400][1]=561135