Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Q:operator overloading?

Status
Not open for further replies.

shebo

Member level 2
Member level 2
Joined
Mar 28, 2006
Messages
42
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,288
Location
do you ever care?
Activity points
1,553
i'm using VC++
which is performance wise ?

1 -
CDMatrix& CDMatrix::eek:perator -(CDMatrix& in)
{

for(int i=0;i < this->row ;i++)
{
for(int j=0;j < this->column ;j++)
{


tmp.MData[j]=MData[j]-in.MData[j];
}

}

return(tmp);
}


where tmp is a new object of the class CDMatrix

or
2-

void CDMatrix::eek:perator-=(CDMatrix& IM){
for(int i=0;i < this->row ;i++)
{
for(int j=0;j < this->column ;j++)
{


this->MData[j]=this->MData[j]-IM.MData[j];
}

}
}


where the return value is *this
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top