Session_1 - Lesson 1 Getting Started Until recently...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Lesson 1 – Getting Started Until recently, programs were thought of as a series of procedures that acted upon data. The essence of object-oriented programming is to treat data and the procedures that act upon the data as a single “object”—a self-contained entity with an identity and certain characteristics of its own. C++ fully supports object-oriented programming which includes the following: Encapsulation Inheritance Polymorphism Encapsulation is the property of being a self-contained unit. With encapsulation we can accomplish data hiding. Data hiding is the highly valued characteristic that an object can be used without the user knowing or caring how it works internally. C++ supports the properties of encapsulation through the creation of user-defined types, called classes . Inheritance allows for the extension of an existing type (reuse existing code). The new subclass derives from an existing type and is sometimes called a derived type. Polymorphism is the ability of allowing C++ to support the concept that different objects do “the right thing”. There is function polymorphism and class polymorphism. Poly means many, and morph means form. Polymorphism refers to the same name taking many forms. C++ was invented by Bjarne Stroustrup, Bell Lab, 1980s, who used “C” as the base language. C++ is a superset of C and virtually any legal C program is a legal C++ program, but the leap from C to C++ is significant. It is true that you can learn C++ without C. The ANSI Standard (American National Standards Institute) has created an international standard for C++. The C++ Standard is now also referred to as ISO (International Standards Organization) Standard. Also called the X3 Standard and ANSI/ISO Standard. Text Book uses the ANSI standard term. Development Environment Save your files as “cpp” or “cxx” depending on the compiler. Don’t use a word processor that saves special formatting characters. If you do, save the file as ASCII text. As you compile the source code, an object file is produced. The file often has the extension “.obj” which is not an executable program. To turn the “obj” file into an executable file, you must link it. Page 1 of 8
Image of page 1

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

View Full Document Right Arrow Icon
So the process is: Create a source code file with a “.cpp” extension. Compile the source code into a file with the “obj” extension.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern