Reference vs. Pointer

Reference Pointer
1>is an object which IS AN ALIAS for another object.] [is an object that CONTAINS THE ADRRESS IN MEMORY of another object]

2>the preferred way of undirectly access objects.] [you should use it just if you really need it, as it it lets you to work in a lower level than a reference does]

3>keeps your code clear .] the code is less clear but still understandable

4>it must be initialized when created . you don’t have to initialize it when declared

5>it references to the one object and only
that one, therefore you can not modify
the address referenced.]
because it contains an address, it can point to many different objects during lifetime. The address can be manipulated

6>when used, the address is dereferenced without using any particular operator] the address must be dereferenced using the * operator

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: