So I am writing this code for my class.
the information in TruckTireTemp.txt is as follows:
Can somebody tell me what the output looks like on a program that recognizes getline() as a function?
Here is the code I wrote
When I do this it always says "no matching function for call to 'getline'"
the information in TruckTireTemp.txt is as follows:
Code:
65
77
68
80
59
78
79
89
58
69
Can somebody tell me what the output looks like on a program that recognizes getline() as a function?
Here is the code I wrote
Code:
#include<iostream>
#include<fstream>
#include <string>
using namespace std;
int main()
{
string myline;
ofstream myfile ("TruckTireTemp.txt");
if(myfile.is_open())
{
while ( ! myfile.eof())
{
getline(myfile, myline);
cout << myline <<endl;
}
myfile.close();
}
else cout << "Ooops! Unable to open file" <<endl;
system("pause");
return 0;
}
When I do this it always says "no matching function for call to 'getline'"
Last edited by a moderator: