- Joined
- 1/15/15
- Messages
- 238
- Points
- 28
Hi. so my code runs fine when i run
ifstream file(file address);
while(file.good())
{
input each variable in dataset into each vector i created
}
However, when I try to add a second file so i can do the same thing with a new dataset,
ifstream file2(file2 address);
while(file2.good())
{
}
i get an error when i run my code. i feel like i'm using ifstream wrong. Also I heard file.good() ends when it reaches eof so after that it stops running, which is why file2's not running. But clearing file is not helping. Debug is telling me that my second dataset is not being inputted. Thank you
ifstream file(file address);
while(file.good())
{
input each variable in dataset into each vector i created
}
However, when I try to add a second file so i can do the same thing with a new dataset,
ifstream file2(file2 address);
while(file2.good())
{
}
i get an error when i run my code. i feel like i'm using ifstream wrong. Also I heard file.good() ends when it reaches eof so after that it stops running, which is why file2's not running. But clearing file is not helping. Debug is telling me that my second dataset is not being inputted. Thank you