I'm trying to read data from a separated file into array of structures. Somehow this thing is driving me crazy. I did almost the same thing with my teacher on another example but her works, mine doesn't. Please please please help me. Thank you in advance Here is my complete code to read but it doesn't do it. FML
include <iostream>
include <fstream>
include <iomanip>
include <string>
include <cctype>
using namespace std;
struct itemtype
{
int id;
int onhand;
double price;
string description;
};
void get_data (itemtype[], int&); int main()
{
itemtype inventory [20];
int count = 0;
int i = 0;
get_data (inventory, count);
for (i = 0; i < count; i++);
{
cout << inventory[count].id << " " << inventory[count].onhand
<< " " << inventory[count].price << endl
<< inventory[count].description << endl << endl;
}
system ("pause");
return 0;