char *getString()
{
char str[] = "Will I be printed?";
return str;
}
int main()
{
printf("%s", getString());
getchar();
}
Shouldn't the output be "Will I be printed?" ? Instead, the output is coming out to be some garbage value. Why is it so?