A. getc() moves forward in a stream and ungetc() moves backward.
So it is possible, although not necessarily desirable, to read the same line (or a group of characters) from stdin - twice
B. length of input line - use strlen() in string.h
Code:
char tmp[256];
memset(tmp,0x00,sizeof(tmp));
if(fgets(tmp,255,stdin)!=NULL) printf("length=%u\d\n",strlen(tmp));
C. atoi(), atof(), strtod() all ignore control characters and spaces. They stop reading the string when they encounter one.
You should get a copy of Herbert Schild's book 'C The complete reference' or something like it. It's organized so that if you look in the File I/O section for a few minutes you could have found ungetc()