Actually, there is one minor correction I would make besides the my other reccmendations:
Code:
printf("%u is not betweem 1 and %u.\n", count, MAXNUMS);
// Should be:
printf("%u is not betweem 1 and %d.\n", count, MAXNUMS);
The #define is interpreted by the compiler as an "int", not an "unsigned int".
It doesn't result in an error, but when I use "cppcheck" on Linux, it does report as a warning.
Only ran cppcheck on Linux. It should be available for MacOS, along with others.
ccpcheck output:
Code:
foo.c:52:10: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint]
printf("%u is not betweem 1 and %u.\n", count, MAXNUMS);
^