int my_getnbr(char *str) { int nb; int neg; nb = 0; neg = 1; while (*str == '+' || *str == '-') { if (*str == '-') neg = neg * -1; str = str + 1; } while (*str != '\0') { if (*str >= '0' && *str <= '9') { nb = nb * 10; nb = nb + *str - '0'; str = str + 1; } else return (nb * neg); } return (nb * neg); }