I am trying to make my program print out the contents of a vector containing objects of class type Checking
i want it to print the balance of each element in the vector but when i try to use cout<<checking[1]
// Class automatically generated by Dev-C++ New Class wizard
#ifndef ACCOUNT_H
#define ACCOUNT_H
// No description
class Account
{
public:
// class constructor
Account(int, double);
// class destructor
~Account();
voidoperator+=(double);
voidoperator-=(double);
void setAccountNum(int);
int getAccountNum();
void setbalance(double);
double getbalance();
private:
int AccountNum;
double balance;
};
#endif // ACCOUNT_H
// Class automatically generated by Dev-C++ New Class wizard
#ifndef CHECKING_H
#define CHECKING_H
#include "account.h" // inheriting class's header file
// No description
class Checking : public Account
{
public:
// class constructor
Checking(int, double);
// class destructor
~Checking();
};
#endif // CHECKING_H
checking.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Class automatically generated by Dev-C++ New Class wizard
#include "checking.h" // class's header file
// class constructor
Checking::Checking(int num, double bal): Account(num, bal)
{
// insert your code here
}
// class destructor
Checking::~Checking()
{
// insert your code here
}