Loading a certain line in a text file as string

#include <iostream>
1)I have a txt file containing file names in every line (about 120)
(1ay.tif
1by.tif
1cy.tif
... )

2) I will use a for loop to load each image, process, and save

3)???
4) Profit

#include <fstream>
#include <string>
using namespace std;

int main () {
string line;
ifstream myfile ("resim.txt");
getline(myfile,line);
cout << line << endl;
return 0;
}

So far i can only write the first line on the console. I want to be able to define this first line as a string (str="1ay.tif"), also the other 120 lines as well
while( getline(myfile, line) ) cout << line << endl;

I want to be able to define this first line as a string
what does that mean? it already is a string.
Topic archived. No new replies allowed.