Question: I have read many things about STL containers (`Sequence Containers`, `Associative Container`, `Container adapters`) but I'm still don't understand the internal form for each of them. 

I want visualization form supported with pictures to every container in STL, (ex: what is the form of data inside the container) if is possible.

I hope that my question be clear.

Answer: 
Most 'terminals' do not send keyboard input to the program 'one key at at time'. Rather, the terminal will wait for the enter key, and then send all keys pressed (up to that point) to the target program. Hence, the question code suffers from getting newlines `\n` as input, as well as digits.

The code below throws away all non-digit values (but also allows for the EOF value):

```
#include <stdio.h>
#include <ctype.h>

int main(void)
   {
   int c;

   do {
      c=0;
      /* Get user input */
      printf("Please enter a digit: ");
      while(!isdigit(c) && EOF != c)
         c = getchar();

      /* Produce output. */
      if(c == EOF)
         printf("\n");
      else
         printf("The digit entered was: %c\n", c);
      } while (c != EOF);

   return 0;
   }

```

Compile the above (Linux GCC example: `gcc -Wall -o test *.c`)

Then execute: (Linux example: `./test`)

```
Please enter a digit: 5
The digit entered was: 5
Please enter a digit: 6
The digit entered was: 6
Please enter a digit: <CTRL-D> 

```

`<CTRL-D>` usually generates an EOF condition.
Well, it's the trouble about the new-line character that you feed the standard input with while handing your piece into the console screen.

Let me ask you this:

With the code that you have said to work perfectly, you probably have tried some input like `"Hello!"` let's say, or maybe just a single character like `"9"` as in your example. You have typed down `'H'` then `'e'` then `'l'` ... then `'!'` and then hit the *enter-key*, or just `'9'` and then hit the *enter-key*.

After that, you had the following on your screen:

```
Hello!
Hello!
_

```

The last underscore there is for indicating the flashing cursor. My question is: Why is it there? Why is it not right next to the last `'!'`?

Same story with the `9`, this would be the things on your screen:

```
9
9
_

```

Well, here's why: It is because your programme has printed one more character that you cannot see directly, a new-line character `'\n'`. Proof: If it hadn't printed that, the underscore would flash next to the `'!'` or `'9'`.

When you hit your *enter-key*, you feed the standard input with a new-line character `'\n'` in addition to whatever you had typed down so far in that session. Standard input gets fed with all that and `getchar();` consumes them one by one.

In your code which doesn't work as you had expected, you feed the standard input with `'9' '\n'`, `getchar();` first gets the `'9'` and then `'\n'`, and then it looks for more, but there isn't any more. Only then (when there isn't more) it asks from you for more.

And that's the story...

To get what you were expecting, you should do something else, I won't tell you that directly, it's a good exercise. I can hint you that you should be using another `while` loop within the one you already have with a condition checking for a `'\n'` encounter.

`EOF` is just a special character, or rather a value indicating a special case of being at the End Of File. For standard input, I guess it can be issued with the `CTRL + D` key combination on Linux, it is `CTRL + Z` on Windows. Using that combination and then hitting enter should get you out of that outer loop.