I am trying to do my homework (fairly new to c++) and it requires me to create a program that will read any .csv files from yahoo finance. I know how to read a specific file, but i do not know how to generalize this
I have tried searching on google but nothing really answered my question.
this is what i did to read a specific file
ifstream file;
file.open("GLD.csv");
if (file.is_open()) {
while (getline(file, line)) {
cout << line << endl;
we are required to change the csv file in the folder of our main .cpp file, so the file name is not going to be "GLD.csv" all the time. How would i "generalize" the reading of the input to different .csv files? thank you