K
Kench
I was curious and playing with pointers and references to see what's
different between them.
Other than the obvious ones involving C++ syntax & things like references
cannot be modified with addition & subtraction,
pointers can be modified, both are similar.
It stated me going what are the diferrence between a reference vairable and
local variable ?
Here are what I can think of
1. For a local variable constructor is called, not the case for a reference
variable.
2. Local variable cannot be NULL. Reference variable can point to a NULL
object by a simple trick like. Employee* e = NULL; Employee* ref = *e;
Anything else?
different between them.
Other than the obvious ones involving C++ syntax & things like references
cannot be modified with addition & subtraction,
pointers can be modified, both are similar.
It stated me going what are the diferrence between a reference vairable and
local variable ?
Here are what I can think of
1. For a local variable constructor is called, not the case for a reference
variable.
2. Local variable cannot be NULL. Reference variable can point to a NULL
object by a simple trick like. Employee* e = NULL; Employee* ref = *e;
Anything else?