lately I have been asking questions a bit over my head so Im trying to break things down a little so I can understand it better.
What Im trying to do is look at all integers and if any of them are not 0-9 then return an error.
I was doing well with this earlier today but I have looked at so many different ways to code this that Im starting to confuse myself. I was curious if someone could please look at what I have and see where my mistake is?
int main (void)
printf("Enter number: ");
fgets(buff, BUFSIZ, stdin);
if( valid(buff, BUFSIZ, a))
printf("Output: %d\n", a);
printf("This is an error string\n");
int valid(int array, int count, int a)
for (i = 0; i < count; i++)
if (array[a] >= 0 && array[a] <= 9)