C
cppaddict
I understand that there are a couple differences between reference
variables and pointer:
1) reference variables *must* be initialized.
2) You cannot change what a reference variable refers to.
My question is: In what situations is it better to use a reference
variable over a pointer? Also, are there other differences besides
the ones I listed above?
Thanks,
cpp
variables and pointer:
1) reference variables *must* be initialized.
2) You cannot change what a reference variable refers to.
My question is: In what situations is it better to use a reference
variable over a pointer? Also, are there other differences besides
the ones I listed above?
Thanks,
cpp