string to number doesn't work

Hi, i want to know how this sentences don’t work

char my_string[3] = {‘6’,‘7’,‘8’};
uint32_t aux;

aux = atoi(my_string);

aux is always 0!

Any help?

Try add NULL character at the end of the array.


char my_string[4] = {'6','7','8', '\0'};
uint32_t aux;

aux = atoi(my_string);