Reputation: 2016
The errors go away when I remove the couts/cins:
std::basic_istream<_CharT, Traits>::_istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char, _Traits = std::char_traits, std::basic_istream<_CharT, Traits>::_istream_type = std::basic_istream]
And here's the code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int x;
int y;
int z;
cout << "Enter number of girrafes" << endl;
cin >> x >> endl;
cout << "Enter number of elephants" << endl;
cin >> y >> endl;
cout << "Enter number of tigers" << endl;
cin >> z >> endl;
}
Upvotes: 0
Views: 82
Reputation: 18066
Remove the endl
from the cin statments:
e.g: cin >> x;
instead of cin >> x >> endl;
Upvotes: 1
Reputation: 258618
cin >> x >> endl;
is illegal, it's basically saying "read into endl
".
Just use cin >> x;
.
Upvotes: 3