• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

ifstream multiple files

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
 
Back
Top