I wonder whether the reference variables such as c in this code:
c
int a = 5; int & c = a;
are allocated from heap or stack.
References are just aliases and do not have to be allocated anywhere in particular. The standard doesn't specify this kind of detail, to the point where it isn't even required that references have any storage at all.