hi, im new to programming in C and im sorta stuck looking for some help
i wanna write a preogram that would read in numbers as ascii characters. it will read in a number ie 1234, 1, 3456 or 12 etc.
and be stored in a character arrray.
the problem now is how do i make scanf terminate by NOT typing anything but just hitting enter
part of the code i have for that part is:
i tried using == '\0' , NULL, '\n' and it wont enter the if loop. any pointers ?? thnx a lot!Code:printf("please enter a positive number followed by <enter>:\n"); scanf ("%s", charArray); if (charArray[0] == 0) { //do something... }