Suppose I have:
Operand[2][4] = {{"1", "2", "3", "4"},{"5", "6", "7", "8"}};
and I have some bit variables called Operand1_sign and Operand2_sign (0: positive and 1: negative) suppose they are:
Operand1_sign = 0;
Operand2_sign = 1;
How can I convert this into 2 integers and apply some operation on them (such as summation)
i.e.
signed int Operand1, Operand2, Result;
so finally I can get the following:
Operand1 = + 1234;
Operand2 = - 5678;
Result = Operand1 + Operand2;
I could suggest this:
However, I would definitely recommend you get your strings as null terminated strings. In that case, you could skip the manual implementation of my_atoi, and just do: