How could I change an array of character (string) to an integer number without using any ready function (ex atoi();) for example :-
char a[5]=\'4534\';
You can go like this
It's working
#include #include #include int main() { char a[5] = "4534"; int converted = 0; int arraysize = strlen(a); int i = 0; for (i = 0; i < arraysize ; i++) { converted = converted *10 + a[i] - '0'; } printf("converted= %d", converted); return 0; }