+ 1

No match for 'operator >>' (operand types are ' std::basic_istream<char> and <unresolved and overloaded function types>

#include <iostream> #include <string> using namespace std; int main() { // perimeter finder unsigned long int a;//sides of triangle unsigned long int b; //sides of triane unsigned long int c; // sides of triangle string f ; //triangle type cout << " type of triangle " << endl; cin >> f >> endl; cout << " enter first side " << endl; cin >> a >> endl; cout << " enter second side " << endl; cin >> b >> endl; cout << " enter third side " << endl; cin >> c >> endl; switch (f){ case: f = "equilateral"; cout << a*3 << endl; break; default: cout << a+b+c << endl; break; } return(0); }

15th Jan 2019, 9:09 AM
Лена Головач
Лена Головач - avatar
1 Resposta
+ 6
Actually you cannot use endl in cin and You can only use switch on primitive such as int, char and enum. 
15th Jan 2019, 10:15 AM
Misaka
Misaka - avatar