Operator>> no match error

#include<iostream>
#include<conio.h>
#include<string>

using namespace std;
class Bank_acc
{
private:
char name,type;
long int accno,temp,t,balance;

public:
void putdata()
{
cout<<"Enter Name of account holder: ";
cin>>name>>endl;
cout<<"Enter account number: ";
cin>>accno>>endl;
cout<<"Is the account a savings account or a current account? (s/c): "<<endl;

if(cin>>"s")
type="savings";

if(cin>>"c")
type="current";

cout<<"Enter Your balance amount: ";
cin>>balance;
}

void dispdata()
{
cout<<"Account holder name: "<<name<<endl;
cout<<"Account number: "<<accno<<endl;
cout<<"Account type: "<<type<<endl;
cout<<"Balance amount: "<<balance<<endl;
}

void deposit()
{
cout<<"Enter the amount you want to deposit:";
cin>>temp;
balance=balance+temp;
cout<<endl<<"Your new balance is: "<<balance<<endl;
}

void withdraw()
{
cout<<"Enter the amount you want to withdaw: ";
cin>>temp;
balance=balance-temp;
cout<<endl<<"Your new balance is: "<<balance<<endl;
}

};

void main()
{
bank_acc acc;
cout<<"Enter account details: "<<endl;
acc.putdata();
cout<<endl;
cout<<"what do you want to do?"<<endl<<"1. Display account details"<<endl<<"2. deposit amount"<<endl<<"3. withdraw amount"<<endl;
cin>>t;
switch(t)
{
case 1:
acc.dispdata();
break;

case 2:
acc.deposit();
break;

case 3
acc.withdraw();
break;

default:
cout<<"Invalid entry";
};

}






This code is for entering a set of bankdetails using class
It shows error at line 16 as:
C:\Users\KarnageKnight\Downloads\BANK_ACC.CPP|16|error: no match for 'operator>>' (operand types are 'std::basic_istream<char>' and '<unresolved overloaded function type>')|


PLease help. What am i doing wrong?
cin>>name>>endl; should be cin>>name;
Thank you for ur reply Yanson,
yes it shows no error at line 16 now.|
But i have another problem now

At line 21, it reads an error msg stating:

C:\Users\KarnageKnight\Downloads\BANK_ACC.CPP|21|error: no match for 'operator>>' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'const char [2]')|

I need help.Thanks in advance :-D
1
2
3
4
cout <<endl<< "Is the account a savings account or a current account? (s/c): "<<endl;
        cin >> s;
		if(s=='s')
		 type='savings';



i guess this was all that ws needed to make it work
Topic archived. No new replies allowed.