Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++ int class

Status
Not open for further replies.

zzfive03

Programmer
Jun 11, 2001
267
Perhaps someone can help me.

I have a homework assignemt for school.
We have been instructed to create an 'Int' class (simular to the 'int' class) That can add, multiply, devide, and subtract.

I am still somewhat new to C++. Where can I go to find info on the int class? How would I start the class? Would it be a template? Can someome show me an example.

Thank you in advance for your help.
Mark
 
Look for Class "compex" (on MSDN or in help of Your VC) , all Functions You needs are in that class.
 
I belive tchouch ment the "complex" class. Or you could start like this in your .h file

class Int
{
public:
Int();
~Int();
int Multiply(int FirstNumber, int SecondNumber);

};

then in your cpp file

Int::Int()
{

}

Int::~Int()
{

}

int Int::Multiply(int FirstNumber, int SecondNumber)
{
return FirstNumber*SecondNumber;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top