Click here to Skip to main content
15,892,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Named Mutex not visible from DLL Pin
Bram van Kampen13-Dec-09 21:34
Bram van Kampen13-Dec-09 21:34 
QuestionIm just new in c++ [modified] Pin
Amr M. K.11-Dec-09 9:32
Amr M. K.11-Dec-09 9:32 
AnswerRe: Im just new in c++ Pin
«_Superman_»11-Dec-09 9:53
professional«_Superman_»11-Dec-09 9:53 
GeneralRe: Im just new in c++ Pin
Amr M. K.11-Dec-09 9:58
Amr M. K.11-Dec-09 9:58 
GeneralRe: Im just new in c++ Pin
EliottA11-Dec-09 9:58
EliottA11-Dec-09 9:58 
QuestionRe: Im just new in c++ Pin
CPallini11-Dec-09 11:30
mveCPallini11-Dec-09 11:30 
AnswerRe: Im just new in c++ Pin
Luc Pattyn11-Dec-09 11:53
sitebuilderLuc Pattyn11-Dec-09 11:53 
GeneralRe: Im just new in c++ Pin
Amr M. K.11-Dec-09 12:31
Amr M. K.11-Dec-09 12:31 
#include <iostream>

using namespace std;
class A
{

private:
int x;
int y;

public:

A()
{
x = 0;
y = 0;
}

A(int First, int Second)
{
x=First;
y=Second;
}

// Opertator
// A operator= ( A &oA);
A operator- ( A oA);
A operator+ ( A oA);

A& operator++(int unu); // prefix

int GetMyX() { return x; }
int GetMyY() { return y; }

void SetMyX(int Xvalue)
{
x=Xvalue;
}



void SetMyY(int Yvalue)
{
y=Yvalue;
}

void Out()
{
cout<<"Value Of x:" << GetMyX()<<" "<<"Value Of y:"<<GetMyY()<<endl ;
}
};


A A:: operator- (A oA)
{
oA.SetMyX (oA.GetMyX ()-x);
oA.SetMyY (oA .GetMyY ()-y);

return oA;
}

A A::operator+ (A oA)
{

oA.SetMyX (oA.GetMyX ()+x);
oA.SetMyY (oA .GetMyY ()+y);
return oA;
}


A& A::operator++(int temp)
{
SetMyX (GetMyX ()+1);
SetMyY (GetMyY ()+1);
return *this;
}


int main()
{
using namespace std;
A a1(2,4);
A a2(3,6);
A a3(0,0);

a1++;

a1.Out ();
a3=a1+a2;
a3.Out ();

a3=a1-a3;

a3.Out ();

int x;

cin>>x;
return 0;
}

Yes. CreatiVity withOuT limiTs

GeneralRe: Im just new in c++ Pin
Tim Craig11-Dec-09 18:23
Tim Craig11-Dec-09 18:23 
QuestionRe: Im just new in c++ Pin
David Crow11-Dec-09 15:24
David Crow11-Dec-09 15:24 
Questiontaking a video from usb cam Pin
Asmaa Khaled FCI11-Dec-09 8:22
Asmaa Khaled FCI11-Dec-09 8:22 
AnswerRe: taking a video from usb cam Pin
loyal ginger11-Dec-09 9:33
loyal ginger11-Dec-09 9:33 
GeneralRe: taking a video from usb cam Pin
Sauce!11-Dec-09 19:09
Sauce!11-Dec-09 19:09 
AnswerRe: taking a video from usb cam Pin
Tim Craig11-Dec-09 18:26
Tim Craig11-Dec-09 18:26 
AnswerRe: taking a video from usb cam Pin
__erfan__11-Dec-09 23:09
__erfan__11-Dec-09 23:09 
Questioncover a double x to char ??? Pin
a04.lqd11-Dec-09 8:10
a04.lqd11-Dec-09 8:10 
AnswerRe: cover a double x to char ??? [modified] Pin
Luc Pattyn11-Dec-09 8:45
sitebuilderLuc Pattyn11-Dec-09 8:45 
GeneralRe: cover a double x to char ??? Pin
CPallini11-Dec-09 11:28
mveCPallini11-Dec-09 11:28 
GeneralRe: cover a double x to char ??? Pin
Luc Pattyn11-Dec-09 11:52
sitebuilderLuc Pattyn11-Dec-09 11:52 
JokeRe: cover a double x to char ??? Pin
CPallini11-Dec-09 23:55
mveCPallini11-Dec-09 23:55 
AnswerRe: cover a double x to char ??? Pin
Richard MacCutchan12-Dec-09 1:52
mveRichard MacCutchan12-Dec-09 1:52 
Questionprint double array on openGL window??? Pin
a04.lqd11-Dec-09 7:51
a04.lqd11-Dec-09 7:51 
AnswerRe: print double array on openGL window??? Pin
Richard MacCutchan12-Dec-09 1:50
mveRichard MacCutchan12-Dec-09 1:50 
QuestionConvert _variant_t to char* Pin
lemonash11-Dec-09 7:01
lemonash11-Dec-09 7:01 
AnswerRe: Convert _variant_t to char* Pin
Rolf Kristensen12-Dec-09 2:52
Rolf Kristensen12-Dec-09 2:52 

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.