I have a main function that has to receive a string.
main()
{
    char *c = fun();
}
char* fun()
{
    char a[] = "hello";
    return a;
}
The problem is that if I return string of lenght 3 or less, then everything is good. If I return string of length > 3, then I receive garbage value along with the string. Why is that ?
 
     
     
     
    