I\'m attempting to create my own atoi function. With the following I\'m getting a return value of 0. Whatever I change the number variable within the function is what I get
Some comments:
int atoi_me(const char *numstring)...
Better to use const type pointer, as you don't intend to modify string contents.
int main()
{
char number[MAXSIZE]; // array of chars
int num;
printf("Please enter a number:\n");
scanf("%s", number); // enter a string, not a char
num = atoi_me(number); // pointer to char, not pointer to pointer
printf("%d", num);
return 0;
}