Click here to Skip to main content

Managed C++/CLI

 
QuestionLarge integer class please help PinmemberMsemler9328-Sep-12 2:29 
AnswerRe: Large integer class please help PinmvpRichard MacCutchan28-Sep-12 3:05 
AnswerRe: Large integer class please help Pinmemberjschell28-Sep-12 11:22 
GeneralRe: Large integer class please help PinmemberMsemler9329-Sep-12 10:52 
ok me and my friend have been working on the program and are having trouble getting the arrays to pass to the functions and dont know where the issue is.


#include
using namespace std;


class Integer{

public:
Integer();
Integer(Integer& a);
Integer operator +(const Integer &);
Integer operator -(const Integer &);
bool operator<(Integer)const;
void SetArr();
void print();
void addNumbers();
void subNumbers();

private:
bool sign;
int size;
int size2;
int size3;
char * arr1;
char * arr2;
char * arr3;


};

int main()
{
Integer sum,diff, in1,in2;
in1.SetArr();
/*in2.SetArr();

in1.addNumbers();
in1.print();
in1.subNumbers();
in1.print();*/




}
Integer::Integer()
{
size=0;
arr1=NULL;
}
Integer::Integer(Integer& a)
{
a.size=0;
a.arr1=NULL;
}
void Integer::SetArr()
{
cout<<"How many digits is the number?"<<endl;
cin>>size;
int* arr1=new int[size];
cout<<"Enter the sequence of the "<<size<<" integers"<<endl;
for(int i=(size-1);i>=0;i--)
cin>>arr1[i];

cout<<endl;
for(int i=0;i>size2;
int* arr2=new int[size2];
cout<<"Enter the sequence of the "<<size2<<" integers"<<endl;
for(int i=(size2-1);i>=0;i--)
cin>>arr2[i];

cout<<endl;
for(int i=0;i=size2)
size3=size+1;
else
size3=size2+1;

int* arr3=new int[size3];


int carry=0;
for(int i=0;i=0;i--)
cout<<arr3[i];

cout<<endl<<endl;




for(int i=0;iarr2[i])
arr3[i]=arr1[i]-arr2[i];
else{
arr1[i+1]=(arr1[i+1]-1);
arr1[i]=arr1[i]+10;
arr3[i]=arr1[i]-arr2[i];
}
}
cout<<endl;
for(int i=0;i=0;i--)
cout<<arr3[i];

}
void Integer::print()
{
for(int i=0;iarr2[i])
arr3[i]=arr1[i]-arr2[i];
else{
arr1[i+1]=(arr1[i+1]-1);
arr1[i]=arr1[i]+10;
arr3[i]=arr1[i]-arr2[i];
}
}
}
GeneralRe: Large integer class please help Pinmemberjschell30-Sep-12 9:12 
QuestionHOW CAN I CREATE A TRAPEZUM WITH A CIRCLE INSIDE IT??(CODE) Pinmemberwilliamjr19-Sep-12 23:09 
AnswerRe: HOW CAN I CREATE A TRAPEZUM WITH A CIRCLE INSIDE IT??(CODE) PinmemberWes Aday20-Sep-12 4:57 
AnswerRe: HOW CAN I CREATE A TRAPEZUM WITH A CIRCLE INSIDE IT??(CODE) PinprotectorPete O'Hanlon20-Sep-12 5:40 
QuestionWindows Shutdown notification in a MFC Dialog app Pinmembersunilkpv13-Sep-12 1:20 
AnswerRe: Windows Shutdown notification in a MFC Dialog app PinmvpRichard MacCutchan13-Sep-12 1:27 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150414.1 | Last Updated 17 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid