[c++] Need help with pointers?
Hi I want to make a program that can read data from a text file into memory.
Here is the format of the text file:
Quantity
Brand
Cost
So text file 1 could be:
2
Dodge
15000
And text file 2 could be:
2
Dodge
15000
4
Toyota
6500
I have created a struct called
Code:
struct Car
{
int quantity;
char brand[20];
double cost;
};
Now how I input data into the struct if I don't even know how big the struct array size should be?
In my main I have Car Cars[]; declared but I have left the brackets empty because I don't know what the size it should be.
Please help me with this.