Classes - Classes Dr. David A. Gaitros Florida State...

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

View Full Document Right Arrow Icon
Source: Absolute C++, Savitch, Addison-Wesley Classes Dr. David A. Gaitros Florida State University
Background image of page 1

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

View Full DocumentRight Arrow Icon
Source: Absolute C++, Savitch, Addison-Wesley Classes A sophisticated structure within a programming language that has associated with a single name: public member functions private member functions (can only be used by the class) public data ( rare) private data (most common) 6-2
Background image of page 2
Source: Absolute C++, Savitch, Addison-Wesley Object The value of a variable is called an object. An object has both data members and data functions. When programming in classes a program is viewed as having a collection of objects (things that have data and functions that use the data) 6-3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Source: Absolute C++, Savitch, Addison-Wesley Classes Similar to structures Adds member FUNCTIONS Not just member data Integral to object-oriented programming Focus on objects Object: Contains data and operations In C++, variables of class type are objects 6-4
Background image of page 4
Source: Absolute C++, Savitch, Addison-Wesley Class definition usually has two distinct parts: Class definition usually written as a .h file. Does not contain executable code but provides the compiler with the visible definitions of the class (What the programmer who is using the class can use.) Class implementation usually written as a .cpp file. Includes (#include) the .h file and contains all of the code that make the class work. 6-5
Background image of page 5

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

View Full DocumentRight Arrow Icon
Source: Absolute C++, Savitch, Addison-Wesley Old Style Data and functions were defined separately Data items or data structures were passed as parameters Results were either passed back as parameters or as a return value 6-6
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/02/2012 for the course COP 3014 taught by Professor Gaitros during the Fall '11 term at Florida State College.

Page1 / 22

Classes - Classes Dr. David A. Gaitros Florida State...

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

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