DID'NT UNDERSTAND THE BUFFER OVERFLOW INPUT IN C PROGRAMMING AS I AM A NEW ONE : HELLO EVERYONE I AM LEARNING C PROGRAMMING AS ITS MY FIRST ONE BUT I DID'NT UNDERSTAND THE ERROR FOR BUFFER OVERFLOW. I TRIED THIS:

    
    #include <stdio.h>
    int main()
    {
    char a[5];
    gets(a);
    printf ("%s",a);
    return 0;
    }

   

now when i type more that 5 words it should end with five isnt'it? but its showing some buffer error and i have no idea about the same. please help me with this .
isn't that a[5] is the word limit of 5?

preety confused? 
sorry if it distrub you all and thanks in advance