which library is "getline" in?
which library is "getline" in?
It's in iostream.
From console:
char line[80];
cin.getline(line,80);
From a file:
char line[80];
char filename = "file.txt";
ifstream in(filename);
in.getline(line,80);
ty
Actually I should have said:
The first example (for console i/o) uses <iostream>.
The second example (for file i/o) uses <fstream>.