   Reference pointer [C++]?
  Dear Threadreader,I have a question regarding references.When I do the following in C++:RenderDevice* ToPointer(Device &device){return &device;}int main(){RenderDevice Device;RenderDevice* PtrDevice = ToPointer(Device);}Will ToPointer returnt he address of the device reference reference on the stack? Or does a reference bypass the stack completly and does it return theaddress of Device in main? I ask this becouse I don' t have the resources to check it right now (my dev pc is in use), but I wurry that I forget this thingwhile my engine is full of this kind of things in the following way:class Texture{public:bool Create(....., Device& device){m_Device = &device;}Device& GetDevice(){return *device;}private:Device* m_Device;};Tjaalie,   
  A reference is the variable for all practical purposes, so taking the address of the reference will yield the address of the variable.   ;  A reference is simply another name of a variable -- all operations on it operate on the referenced variable, not the variable itself (that is, you cannot take the address of a reference -- you'll get back the address of what is referenced, et cetera).In other words, this lineRenderDevice* PtrDevice = ToPointer(Device);is functionally equivalent toRenderDevice* PtrDevice = &Device;  Thanks:DRate++   