This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

subtraction of 2 ascii arrays

Hey i wants to get idea for how to subtact two arrays of ascii chracters of amount....

e.g.

unsigned char ary1[3],ary2[3],ary[3];

ary1[1]=0x32; //0x32 is ascii code for 2
ary1[2]=0x31; //same 0x31 is ascii code of 1
ary1[3]=0x34;

ary2[1]=0x35;
ary2[2]=0x32;
ary2[3]=0x35;

Please give me idea.....
I am facing problem for carry forwarding....

Parents
  • Addendum: you normally borrow for subtraction. But same principle. How do you do it with pen and paper.

    And it's easier if you work with the digits in binary form 0..9 instead of ASCII form. But if you just remember the offset between binary form and ASCII form (you have two offsets - one for each digit) it still isn't that hard.

Reply
  • Addendum: you normally borrow for subtraction. But same principle. How do you do it with pen and paper.

    And it's easier if you work with the digits in binary form 0..9 instead of ASCII form. But if you just remember the offset between binary form and ASCII form (you have two offsets - one for each digit) it still isn't that hard.

Children
No data