Error C2784 - Please Help!

Hi there, I'm new to this forum and pretty new to c++ as well and I can't seem to get this error figured out. Here is the full error message:

C2784: 'std::basic_istream<_Elem,_Traits> &std::operator >>(std::basic_istream<_Elem,_Traits> &&,std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &&' from 'std::ostream'

Here is my C++ code:

#include <iostream>
#include <string>
#include <iomanip>

using namespace std;

int main()

{

string name;
double roomcharge,extracharge,total;
double roomnum,numofdays;
const double roomrate=125;

cout << fixed;

cout << "Please fill in the following information to output the Total room charges, and an invouce for the guest: " << endl << endl;
cout << "Customer Name: ";
getline(cin, name);
cout << "Room Number: ";
cin >> roomnum;
cout << "Number of Days Stayed: ";
cin >> numofdays;
cout << "Extra Charges: ";
cin >> extracharge;

roomcharge=roomrate*numofdays;
total=roomcharge+extracharge;

cout << "Star Hotel Customer Invoice: ";
cout << "Customer Name: ";

system("pause");

}


My Project is still incomplete at the moment, but I don't want to continue until I get this error fixed.

Any help would be appreciated, thanks in advance.
Once I took out the system("pause") that code compiles without problem:

http://ideone.com/DWeSH
Since you don't have something like cout >> name ; anywhere in your code, you should not be getting this error.
Hm, well that's really weird because it's still giving me issues. I think I'll start a new project in Visual Studio and re-enter the code. Thanks for your input.

I'll post my results here after trying a new project.
I expect the code you think you're compiling is not the code you are compiling.
Moschops you may be right. I made a new project and just pasted the same code in, and it built successfully. No idea how or why, but it's fine now. Thanks for all of the help :)

I didn't think I had any errors in my code >.> <.<
Topic archived. No new replies allowed.