Hello, I'm receiving an error when I compile my code for "project06.triangle.cpp". How can i fix the problem without changing any code in the header file?
Here's the code for project06.triangle.cpp:
******************************************************
*********************************************
and the code for project06.triangle.h:
*********************************************
#ifndef TRIANGLE_
#define TRIANGLE_
using namespace std;
#include <iostream>
class Triangle
{
private:
double SideA, SideB, SideC;
bool Valid;
void validate();
public:
Triangle( double = 0.0, double = 0.0, double = 0.0 );
bool is_valid() const;
}
*******************************************
and I'm receiving the following error:
project06.triangle.cpp:177: error: prototype for 'bool Triangle::is_valid()' does not match any in class 'Triangle'
/user/cse232/Projects/project06.triangle.h:44: error: candidate is: bool Triangle::is_valid() const
When I added "const", the previous error didn't come up, but I received this one instead:
project06.triangle.cpp: In member function 'bool Triangle::is_valid() const':
project06.triangle.cpp:179: error: passing 'const Triangle' as 'this' argument of 'void Triangle::validate()' discards qualifiers