destructor in .h and .cpp file

Mar 14, 2014 at 3:06am
I have 'expression must have pointer type' error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
   so in CCC.h file I have 


public:
	//	Constructor definition. As specified, it takes two arguments,
	//  one for the tax and and tip rate
	RestaurantCheck(double taxRate, double tipRate);
	~RestaurantCheck();  //destructor



so in CCC.cpp file I have
//destructor
RestaurantCheck::~RestaurantCheck(){
	delete taxRate;
}

This doesn't work, what should I do? 
Mar 14, 2014 at 3:29am
I am assuming taxRate is of type double?
The delete keyword is only for pointer type variables.
http://www.cplusplus.com/doc/tutorial/pointers/
Last edited on Mar 14, 2014 at 3:30am
Topic archived. No new replies allowed.