int tmp_integer = lua_tointeger(L, i); char* tmp_string = malloc( MAX_INTEGER_DIGITS * sizeof(char)); /*FIXME choose a proper size*/ sprintf(tmp_string, "%d", tmp_integer); a[i - 1] = tmp_string;