REFERENCES VS POINTER
* We can not change the location to which the reference belongs that is why we have to initialize the references when we do declare them unlike we can change the locations to which the pointer belongs.
* We have to dereference the pointers explicitly but the references are pre-dereferenced.
* we cant use ++ on reference variables but we can use ++operator on pointers(as they then after points to the next memory of its type).
No comments:
Post a Comment