Question: I know I can get the first character of a line of standard input by using getchar(), but I *only* want the first character of each line. Is there a function I can use to get rid of the rest of the string entered into standard input (if it is more than one character)? if not, what methodology should I consider using to get rid of the rest of the standard input line?

Answer: 
```
char buf[100];
while(fgets(buf,sizeof(buf),stdin) != NULL)
{
   if(strlen(buf)>0)
      buf[1] = '\0';
   printf("%s",buf);
}

```

Read the whole line using `fgets()` and just nul terminate it after the first character.
```
// Get the character you need
char c = getchar();

// Skip the rest
int a;
while((a = getchar()) != '\n' && a != EOF);

```

If you know how many lines you'll have, you can put it in a loop.