program checks for distance between two points. one function checks for if the two points are the same and returns a 1. program runs, however it always displays "two points are the same distance". It is not doing "else". I dunno whats wrong with it.
# include <iostream>
# include <cmath>
using namespace std;
class Point
{
private:
double x, y, z;
public:
void prompt_user();
void display();
Point();
double dis(Point);
double equal(Point);
Turn this -> if(check = 1) into this -> if(check == 1) and it should be fine.
You see, = is the assignment operator. The operator for equality testing is ==.
The way you do it, the value 1 is stored in check and then check is tested for being true (and of course it is true, because you just stored the value 1 in it)