Consider the following function:
char *f()
{
char *s=malloc(8);
}
main()
{
printf("%c",*f()='A');
}
If I comment the line char *s=malloc(8);
I get an error as if the assignment *f()='A'
accessed invalid memory. Since I never return any variable why does above assignment work at all?
2nd question: 'A'
is assigned to temporary variable created on return of function . So why can't ++a
etc. be used as lvalue?