Yes, getline can be used to read lines from files. To do so, you need to open the file in input mode using an std::ifstream object and then use getline to read the lines one by one until the end of the file is reached.