This is what I have now:
int main() {
int number;
printf("Type your number: ");
scanf("%i",&number);
char code[4];
printf("Type your code: ");
scanf("%s",&code);
When I type anything but numbers in the first one the script goes all crazy, it just shows
Type your number: NOTaNUMBER
Type your code: THErestOFtheSCRIPT
-- Back to command line
What I want it to do is
Type your number: NOTaNUMBER
You didn't enter a number
-- Back to command line
How can I do this?
This is different from the said duplicate. I'm talking about C here, not C++.
C doesn't know cin
, the answer to the said duplicate. However, an answer was found below