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.
You're being tripped up by a trailing newline in your input; when you type `9` and hit `Enter`, the *input stream* that your code reads from will contain the encodings for *two* characters, the `9` and a newline (in ASCII, it would be the sequence of values [57,10]) . Here's how it breaks down:

1. Code prompts you to enter a digit
2. You type `9` and hit Enter
3. Input stream now contains the characters `{'9', '\n'}`;
4. `getchar` returns the next available character from the input stream, which is `'9'`
5. `'9'` is not equal to `EOF`, so you print the digit and prompt for the next character
6. `getchar` returns the next available character from the input stream, which is `'\n'`
7. `'\n'` is not equal to `EOF`, so you print the character and prompt for the next character
8. The input stream is now empty, so `getchar` blocks until you type something else.

You can fix this relatively easily:

```
#include <ctype.h>
...
while (c != EOF)
{
    printf("The digit entered was: ");
    putchar(c);

    printf("Please enter a digit: ");
    do
    {
      c = getchar();
    } while ( isspace( c ));
}

```

That last little `do` loop will read characters from the input stream until it sees something that *isn't* a newline or other whitespace character. You can add an additional check to make sure the character entered really was a digit [0-9]:

```
while (c != EOF)
{
    printf("The digit entered was: ");
    putchar(c);

    do 
    {
      printf("Please enter a digit: ");
      do
      {
        c = getchar();
      } while ( isspace( c ));

      if ( !isdigit( c ))
        printf( "%c is not a digit!\n" );

    } while ( !isdigit( c ));
}

```

Now, something to be aware of; what you're storing in `c` is not the *value* `9`, but the encoding for the *character* `'9'`, which in ASCII is the integer value 57. If you want to store the *value* `9` in `c`, you'll have to do something different.