About the riddle
There is no error with the line: a = func() and that is becuase func returns a pointer to int which is exactly the type of a. On the other hand, the line: *a = 7 is the problematic since a points to no allocated memory -- this would probablly lead to a segmentation fault during running. Syntax-wise -- that program is OK.