Home > Back-end >  Two character arrays together
Two character arrays together

Time:01-04

Char * a
Char * b
Type ab
Then together, how to implement, boom boom bam, solving
Will their

CodePudding user response:

#include
# include "stdlib. H"
Using namespace STD.

Const int length=41;
The class HugeInteger {
Public:
HugeInteger ()
{

}
Void input (char * s)
{
Changdu=new char (length),
Changdu=s;

}
HugeInteger (char * ss)
{
Changdu=new char (length),
Changdu=ss;
}
HugeInteger add (HugeInteger& SSS)
{
HugeInteger c (changdu);
return c;


}
Void the output ()
{
int i;
i=0;
for(; (changdu + 1)=='\ 0'; I++)
If (i> 40)
Cout<& lt;" Outrange ";
The else
Cout}


Private:
Char * changdu.
};




Int main ()
{
HugeInteger hi1;
Char * c=new char (length),
Cin & gt;> c;
Char * d=new char (length),
Cin & gt;> d;
Hi1. Input (c);
HugeInteger hi2 (d);
(hi1. Add (hi2)). The output ();
return 0;
}

CodePudding user response:

They melody, in fact just don't know how to add the two characters together this operation

CodePudding user response:

Alignment, directly add to 48, processing respectively

CodePudding user response:

Loop with a high,

CodePudding user response:

reference 4 floor forever74 response:
and loop handle high,

With guy header file can't change, and the specific is how to realize, is aligned addition step
  • Related