Using a C but not a C++ compiler. We have code like this:
Suppose we have code like this:
main()
{
int *funcko();
int *george = funcko();
printf("%d", goerge[3]);
}
int *funcko()
{
int cat[12];
return cat;
}
What happens when you try this according to the actual rules of C? I am aware that cat
is supposed to be banished after the return, although I would expect the pointer to actually be transmitted to george. However, I don't think it remains an array. Just a lonely pointer?
But I would like to know what the C standard really tells us here.