Your most likely taking about a dynamic array which is an array that you reference by using a dynamic pointer. All arrays are technically referenced by a pointer but it's usually a static pointer that you cannot directly manipulate.
So if you wanted a dynamic array of ints:
|
int* dynamicArray = new int[20];
|
If you fill this array with 20 ints and decide you want to expand you will need to copy it into a larger array:
1 2 3 4
|
int* largerArray = new int[30];
for (int i = 0; i < 20; i++)
largerArray[i] = dynamicArray[i];
|
Now delete the original array:
delete [ ] dynamicArray;
If you wanted to make things easier you could use a vector which function just like an array but will automatically expand for you. (it does the copy process behind the scenes)
EDIT - I think for the sake of convenience your best bet is create struct or class for you transactions and store them in a vector. Even better would be to store them in a map with a transaction number as the key. Then you could implement a search function rather easily.
You could just as easily implement it wuth a vector but you would have to actually search through them all manually.
Here is what I might start with in my transaction class:
int GetTransactionNumber() const;
Print(ostream& out) const;
bool UpdateSale(int sale);
int id;
(class) CustomerInfo; (this would store all their info separately)
double sale;
string item;
and so on....These methods will come in handy and let you encapsulate the data of each transaction.