That wont work because atoi(SUM) will not multiply by i for some reason. How do i fix this. Also the value of atoi(SUM) is too big to be held as an integer of any type which is why i am using a char array for SUM.Code:itoa(atoi(SUM)*=i,SUM,10);
That wont work because atoi(SUM) will not multiply by i for some reason. How do i fix this. Also the value of atoi(SUM) is too big to be held as an integer of any type which is why i am using a char array for SUM.Code:itoa(atoi(SUM)*=i,SUM,10);
The *= operator assigns a new value to the left operand - and you shouldn't be assigning a value to a function's return value. Just use straight multiplication and you should be fine.Code:atoi(SUM)*=i
I'm confused by the rest of your problem. A char is just one byte, but an integer is 4, depending on your implementation. How are you getting a char to hold more? Do you mean you're using a string to represent that number in Base-36 or something?
Also, remember that although atoi() is a standard function, itoa() is NOT. Use strtol() instead.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
Doesn't strtol() just do what atoi() does? ltostr isn't standard either...
There's plenty of source code out there to code up your own function if you want to...