https://man7.org/linux/man-pages/man3/end.3.html may be of interest, if you're running on Linux. But objects can also be static, and there are alternate stacks, so this might be more complicated than it sounds. Why do you need to know? On Fri, Jul 24, 2020, 13:00 aotto <aotto1968@xxxxxxxxxxx> wrote: > Hi, > > a C++ class can be created on the "stack" or on the "heap" > > class A { > int test; > } > > // stack > A myA(); > > // heap > A* myA = new A(); > > > Question: > > it is possible (with gcc) to find out if a instance was created on a > "stack" or on a "heap" * > > > mfg > > >