Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Rounded button problem Pin
toxcct13-Apr-04 22:40
toxcct13-Apr-04 22:40 
QuestionHow to display array of pixel values onto the screen? Pin
Indrawati13-Apr-04 22:07
Indrawati13-Apr-04 22:07 
AnswerRe: How to display array of pixel values onto the screen? Pin
Prakash Nadar13-Apr-04 22:58
Prakash Nadar13-Apr-04 22:58 
AnswerRe: How to display array of pixel values onto the screen? Pin
Iain Clarke, Warrior Programmer13-Apr-04 23:05
Iain Clarke, Warrior Programmer13-Apr-04 23:05 
Questionhow to use kbbar.dll to add a new toolbar in IE Pin
NewtonOfComputers13-Apr-04 21:29
NewtonOfComputers13-Apr-04 21:29 
AnswerRe: how to use kbbar.dll to add a new toolbar in IE Pin
Iain Clarke, Warrior Programmer13-Apr-04 23:09
Iain Clarke, Warrior Programmer13-Apr-04 23:09 
GeneralRe: how to use kbbar.dll to add a new toolbar in IE Pin
NewtonOfComputers13-Apr-04 23:39
NewtonOfComputers13-Apr-04 23:39 
GeneralRe: how to use kbbar.dll to add a new toolbar in IE Pin
Iain Clarke, Warrior Programmer13-Apr-04 23:55
Iain Clarke, Warrior Programmer13-Apr-04 23:55 
GeneralRe: how to use kbbar.dll to add a new toolbar in IE Pin
NewtonOfComputers14-Apr-04 0:32
NewtonOfComputers14-Apr-04 0:32 
GeneralRe: how to use kbbar.dll to add a new toolbar in IE Pin
Iain Clarke, Warrior Programmer14-Apr-04 2:39
Iain Clarke, Warrior Programmer14-Apr-04 2:39 
GeneralRe: how to use kbbar.dll to add a new toolbar in IE Pin
NewtonOfComputers15-Apr-04 23:34
NewtonOfComputers15-Apr-04 23:34 
GeneralCListCtrl's SetItemData() Pin
Shah Shehpori13-Apr-04 21:25
sussShah Shehpori13-Apr-04 21:25 
GeneralRe: CListCtrl's SetItemData() Pin
Rory Solley13-Apr-04 22:02
Rory Solley13-Apr-04 22:02 
GeneralRe: CListCtrl's SetItemData() Pin
rrrado13-Apr-04 22:03
rrrado13-Apr-04 22:03 
GeneralRe: CListCtrl's SetItemData() Pin
David Crow14-Apr-04 2:44
David Crow14-Apr-04 2:44 
QuestionHow to get image from IE ? Pin
rrrado13-Apr-04 19:43
rrrado13-Apr-04 19:43 
Generalchanging the color of the previous selected node of CtreeCtrl Pin
SVPG13-Apr-04 19:27
SVPG13-Apr-04 19:27 
GeneralRe: changing the color of the previous selected node of CtreeCtrl Pin
Rory Solley13-Apr-04 22:05
Rory Solley13-Apr-04 22:05 
GeneralFinding Time Difference in milli seconds Pin
swarnamanoo13-Apr-04 18:39
swarnamanoo13-Apr-04 18:39 
GeneralRe: Finding Time Difference in milli seconds Pin
PJ Arends13-Apr-04 19:04
professionalPJ Arends13-Apr-04 19:04 
GeneralRe: Finding Time Difference in milli seconds Pin
ohadp13-Apr-04 21:07
ohadp13-Apr-04 21:07 
GeneralRe: Finding Time Difference in milli seconds Pin
David Crow14-Apr-04 2:46
David Crow14-Apr-04 2:46 
GeneralOperator Overloading Pin
jss67200113-Apr-04 18:21
jss67200113-Apr-04 18:21 
GeneralRe: Operator Overloading Pin
Anonymous13-Apr-04 19:06
Anonymous13-Apr-04 19:06 
GeneralRe: Operator Overloading Pin
jss67200113-Apr-04 21:25
jss67200113-Apr-04 21:25 
do I need to do something similiar as below in point2d.cpp

//Point2d.cpp
#include <iostream>
using namespace std;
#include "Point2D.h"
Point2D::Point2D()
{
setX(0);
setY(0);
}
Point2D::Point2D(double a, double b)
{
setX(a);
setY(b);
}
Point2D::Point2D(const Point2D& p)
{
setX( p.getX() );
setY( p.getY() );
}
Point2D Point2D::getPoint() const
{
return (*this);
}
double Point2D::getX() const
{
return x;
}
double Point2D::getY() const
{
return y;
}

void Point2D::setX(double a)
{
x = a;
}
void Point2D::setY(double b)
{
y = b;
}
void Point2D::setPoint(const Point2D& p)
{
setX( p.getX());
setY( p.getY());
}
Point2D Point2D::operator+(const Point2D& p)
{
return Point2D( getX()+p.getX(), getY()+p.getY());
}

Point2D Point2D::operator-(const Point2D& p)
{
return Point2D( getX()-p.getX(), getY()-p.getY());
}

bool Point2D::operator<(const Point2D& p) const
{
return (getX() < p.getX() || getY() < p.getY());
}

bool Point2D::operator>(const Point2D& p) const
{
return (getX() > p.getX() || getY() > p.getY());
}
bool Point2D::operator==(const Point2D& p) const
{
return (getX() == p.getX() && getY() == p.getY());
}
Point2D& Point2D::operator++(void)
{
setX(getX()+1);
setY(getY()+1);

return *this;
}

Point2D Point2D::operator++(int dummy)
{
Point2D p = *this;

setX(getX()+1);
setY(getY()+1);

return p;
}




ostream& operator<<( ostream& o, const Point2D& p)
{
o << "(" << p.getX() << ", " << p.getY() << ")";
return o;
}


Thanks

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.