reference or pointer

http://stackoverflow.com/questions/114180/pointer-vs-reference

My rule of thumb is:

Use pointers if you want to do arithmetic with them or if you ever have to pass a NULL-pointer.

Use references otherwise.

 

http://stackoverflow.com/questions/4364536/c-null-reference

reference must be initialized when used.

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s