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....
As Per says, just think about how you would do this "manually" using pencil and paper...
Or, convert the text strings to numbers, and do the arithmetic on the numbers using the standard 'C' arithmetic operators...
But how to subtract two arrays of integers... Is there any solution??
No, you will not be handed a ready-done solution on a plate - you need to think for yourself!
Have you actually thought about the suggestions given so far?
By the way - don't write:
ary1[1]=0x32; //0x32 is ascii code for 2
when it's easier to read (and no need for the comment).
ary1[1]='2';
View all questions in Keil forum