Heres my problem. I tried to compile this program and I am getting error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::all
ocator<char> >' (or there is no acceptable conversion)
I have read the other posts but they are not useful. Here are the lines of error and the relevant code. Not all of the code is here..just the lines indicated by error messages.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
cin >> in_file; // Both of these are for reading
cin >> out_file; // and writing to a file.
inData >> first_name >> middle_name >> last_name >> grade >> month;
first_init = first_name.substr(1,1);
middle_init = middle_name.substr(1,1);
last_init = last_name.substr(1,1);
return 0;
}
Like I said, this is not all of the code...only the affected lines. If anyone could help I would be in their debt.
ocator<char> >' (or there is no acceptable conversion)
I have read the other posts but they are not useful. Here are the lines of error and the relevant code. Not all of the code is here..just the lines indicated by error messages.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
cin >> in_file; // Both of these are for reading
cin >> out_file; // and writing to a file.
inData >> first_name >> middle_name >> last_name >> grade >> month;
first_init = first_name.substr(1,1);
middle_init = middle_name.substr(1,1);
last_init = last_name.substr(1,1);
return 0;
}
Like I said, this is not all of the code...only the affected lines. If anyone could help I would be in their debt.