I think I am getting bad data because I have my pointer doing the wrong thing, I just don't know exactly how to fix it. Any help is greatly appreciated!
output:
Number: 4669840
Name:
Value: 3.76441e-039
Number: 4218312
Name:
Value: 6.52879e-039
Number: 2686408
Name:
Value: 6.52879e-039
Number: 128
Name:
Value: 7.55882e+033
Number: 8392488
Name:
Value: 1.12104e-044
Number: 8392360
Name:
Value: 1.17549e-038
Number: 2686392
Name:
Value: 1.12104e-044
while(!inFile)
{
//Same junk output for this
for(ptr = &company[0]; ptr < &company[SIZE]; ptr++)
{
cin >> (*ptr).budget_num;
cin >> (*ptr).name;
cin >> (*ptr).budget_value;
}
}
for(int i = 0; i < SIZE; i++)
{
cout << "Number: " << company[i].budget_num << endl;
cout << "Name: " << company[i].name << endl;
cout << "Value: " << company[i].budget_value << endl;
cout << endl;
outFile << "Number: " << company[i].budget_num << endl;
outFile << "Name: " << company[i].name << endl;
outFile << "Value: " << company[i].budget_value << endl;
outFile << endl;
}