#ifndef CALOCELL_HH
#define CALOCELL_HH
class CaloCell
{
private:
double e;
int i;
//CaloCell calocell;
public:
CaloCell(double energy, int ID) : e(getValenergy), i(getValid) {};
double getValenergy() const { return e;}
void setValenergy(double newenergy) { e = newenergy;}
int getValid() const { return i;}
void setValid(int newid) { i = newid;}
};
#endif
and the main program is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
#include "calocell.hh"
using std::cout;
using std::endl;
int main()
{
CaloCell c(2.2,2);
//c.CaloCell (2.2,2);
cout << "energy:" ;
c.getValenergy();
cout << endl << endl ;
return 0;
}
I'm getting the following as error message:
In file included from main.cc:2:
calocell.hh: In constructor `CaloCell::CaloCell(double, int)':
calocell.hh:7: error: argument of type `int (CaloCell::)()' does not match `int'
Could anyone pls tell me what is going wrong here?
Thanks