C++ Review

C++ Review - CSC2100a Tutorial C++ Spring 2006/2007 • TAO...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

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

Unformatted text preview: CSC2100a Tutorial C++ Spring 2006/2007 • TAO Chenju n, Vito • 陶塵鈞 • Rm. 913, SHB, CUHK • 2609-8403 • Office hour: Wed. 2:30pm - 4:30pm Outline • C++ • Class • Object • Pointe rs • Array • Friend functions/classes • Templates What is C++ • general-purpose • high-level programming language • low-level facilities • Since the 1990s, C++ has been one of the most popular commercial programming languages. • Object-Oriented Programming Class • A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions. – private members of a class are accessible only from within other members of the same class or from their friends. – protected members are accessible from members of their same class and from their friends, but also from members of their derived classes. – Finally, public members are accessible from anywhere where the object is visible. – Constructors and destructors Class class CRectangle { int x, y; public: void set_values (int,int); int area (void); } Object • An object is an instantiation of a class. In terms of variables, a class would be the type, and an object would be the variable....
View Full Document

Page1 / 26

C++ Review - CSC2100a Tutorial C++ Spring 2006/2007 • TAO...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online