sort of a noob as i have been doing c++ for only a couple months now. my problem is that i am using a function to pass data from a file into an array then into a .out file. the function im using to read the data from the file is using a while loop. the data file consists of the name of a store, then the pattern of a product code then product name then product price repeated over and over for multiple products. the product name has embedded blanks which i try to read with getline but fail horribly. no compiler error just debug assertion failure. using vs. can provide more info if needed. dont think you need main or other functions.function code for reading data is as follows:
long readFile (string code[], string product[], double price[])
{
string temp,
store;
long count;
ifstream fin ("program5.txt");
getline(fin,store);
count=0;
fin>>temp;
while (!fin.eof())
{
code[count]=temp;
getline(fin,product[count]);
fin>>price[count];
count++;
fin>>temp;
}
fin.close();
return count;
}