Noob character numbers question
I've been learning c coding from the book "c coding for dummies" I don't understand why this program is set for 2 characters in the char function. Normally the char function specifies how many characters in the function. I just don't get why this is specified as 2, I tried changing it to 1 and 0 and received the same output from the program. thanks.
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char num[2];
int number;
printf("I am your computer genie!\n");
printf("Enter a number from 0 to 9:");
gets(num);
number=atoi(num);
if(number<5)
{
printf("That number is less than 5!\n");
}
printf("The genie knows all, sees all!\n");
return(0);
}