Message from C, C++ talks
Well, then you can get pointers to whatever variables you need and output them as numbers (for example). But as I know, relative location of different objects (e.g. two unrealted heap or stack allocated variables) is undefined. So you cannot rely on it while writing real software. But if it's just for fun, why not.