I don't know much about c++, so if I could get some ideas it would be good.
I need a program that reads some number of strings that Iam not aware of and also some floats.
The program works in a loop that gets data and builds a table after each time by the loop.
Since I don't know the number of string or floats I will be getting I did this:
1 2 3 4 5
|
int count=1;
string substance[count];
float aSTemp[count];
float emissivity[count];
float heatRadiated[count];
|
then I used a loop and a function to display the data input from the user
obtained in main()
1 2 3 4 5
|
for(int i=0;i<count;i++)
{
displayTable(substance[i],aSTemp[i],emissivity[i],heatRadiated[i]);
}
|
(the initialization happens before the do-while loop where the program runs into.)
and after the program goes by a do-while loop I would increment count++.
After the first time around the program breaks because of the string[count], the rest works fine and the data is recorded and displayed as needed with this exception.
So if anyone could help me solving this without having to initialize an exact number for the array it would be helpful.