Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 1 other subscriber
What would be the output of follow c program?
char str = “Will I be printed?”;
Output: Some garbage value
The above program doesn’t work because array variables are stored in Stack Section. So, when getString returns values at str are deleted and str becomes dangling pointer.