+ 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); }
1 Answer
+ 6
Actually you cannot use endl in cin and You can only use switch on primitive such as int, char and enum.Ā