Write your question here.
i want to calculate the volume of cylinder.......
it shows these error i don't know how to resolve this
C:\Users\maria\Desktop\cinstring\main.cpp|13|error: expected ';' before 'getline'|
C:\Users\maria\Desktop\cinstring\main.cpp|17|error: expected ';' before 'getline'|
C:\Users\maria\Desktop\cinstring\main.cpp|20|error: invalid operands of types 'float' and '<unresolved overloaded function type>' to binary 'operator<<'|
code\
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string mystr;
int rad =0;
float height =0;
cout << "enter the radius :"
getline (cin,mystr);
stringstream(mystr)>> rad;
cout << "enter the height :"
getline(cin,mystr);
stringstream(mystr)>> height;
Did you not see that bolded word in my post? What is before the getline() in line 13? Answer: Line 12! Now look closely at line 12. Do you see anything missing? A semicolon perhaps? Look at kemort's post that contains a copy of your code, he highlighted the problem.