CS280 Exam Help Sheet Spring2014

Xi is the same thing as x i in addition in c

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ur declarations and initialization above, the expression written *xp means “what xp points to”. Since xp is a pointer to an int, *xp is an int. • The semantics of pointer arithmetic is that adding an integer N to a pointer advances the pointer by N times the size of what the pointer points to. X[i] is the same thing as *(X + i). • In addition, in C++ • A variable declared as int & xr; means that xr is a reference to an int. • • A variable of type reference must be initialized when it’s declared. Using a variable of type reference in an expression evaluates to the item that the reference has been initialized to refer to. Regular expression rules X \x M | N MN M*...
View Full Document

This document was uploaded on 04/03/2014.

Ask a homework question - tutors are online