argument of type `int (CaloCell::)()' does not match `int'

Hey guys,

Pls help, I'm trying to compile the following program:

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
#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
Topic archived. No new replies allowed.