no operator matches this operand

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#include <iostream>
#include <string>
using namespace std;

class Account{
	private:
		string firstname;
		string lastname;
		string FullName;
		int accountnumber;
		double balance;
	public:
		Account(){
			firstname = "Raaj";
			lastname = "Lokanathan";
			FullName = "Raaj Lokanathan";
			accountnumber = 5671;
			balance = 0.0;
		}
		Account(string fName,string lName,int accno,double bal);
		void setFullName(string fullname);
		void setaccountnumber(int accno);
		void setbalance(double bal);
		string getFullName();
		int getaccountnumber();
		double getbalance();
		void display();

};

Account::Account(string fName,string lName,int accno,double bal){
	firstname = fName;
	lastname = lName;
	accountnumber = accno;
	balance = bal;
}

void Account::setFullName(string fullname){
	FullName = fullname;
}

void Account::setaccountnumber(int accno){
	accountnumber = accno;
}

void Account::setbalance(double bal){
	balance = bal;
}

string Account::getFullName(){
	return FullName;
}

int Account::getaccountnumber(){
	return accountnumber;
}

double Account::getbalance(){
	return balance;
}

void Account::display(){
	cout<<"First Name: "<<firstname<<endl;
	cout<<"Last Name: "<<lastname<<endl;
	cout<<"Account Number: "<<accountnumber<<endl;
	cout<<"Current Balance: "<<balance<<endl;
}

int main(){
	Account acc;
	acc.setFullName("Raaj Lokanathan");
	acc.setaccountnumber(5671);
	acc.setbalance(0.0);
	acc.display();
	Account acc[50];
	string full_name;
	int acc_no;
	double bAl;
	int i;
	for(i=0;i<50;i++){
		cout<<"Please enter the details for the customer: "<<i+1<<endl;
		cout<<"Please enter your full name: ";
		getline(cin,full_name);
		cout<<"Please enter your account number: ";
		cin>>acc_no;
		cout<<"Please enter your current balance: ";
		cin>>bAl;
		acc[i].setFullName(full_name);
		acc[i].setaccountnumber(acc_no);
		acc[i].setbalance(bAl);
	}
	for(i=0;i<50;i++){
		cout<<"Detail for the bank customers"<<i+1<<endl;
		acc[i].display();
	}

	system("pause");

	return 0;

}



can i know whats the problem there...
What line is the error occurring on?
from line 88-90 and then in line 94 too
Wait...on line 70 and 75 you have two definitions of acc; you should have only one.
tq very much its solved now
Topic archived. No new replies allowed.