img009 - ChapterI C Basics 29 1.1 INTRODUCTION TO C 30...

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

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

Unformatted text preview: ChapterI C++ Basics 29 1.1 INTRODUCTION TO C++ 30 Origins of the C++ Language 30 C++ and Object-Oriented Programming 31 The Character of C++ 31 C++ Terminology 32 A Sample C++ Program 32 1.2 VARIABLES, EXPRESSIONS, AND ASSIGNMENT STATEMENTS 34 Identifiers 34 Variables 36 Assignment Statements 38 Pitfall: Uninitialized Variables 40 Tip: Use Meaningful Names 41 More Assignment Statements 41 Assignment Compatibility 42 Literals 43 Escape Sequences 45 Naming Constants 45 Arithmetic Operators and Expressions 47 Integer and Floating-Point Division 49 Pitfall: Division with Whole Numbers 50 Type Casting 50 Increment and Decrement Operators 53 Pitfall: Order of Evaluation 55 CONSOLE INPUT/OUTPUT 56 Output Using cout 56 New Lines in Output 57 Tip: End Each Program with \n or endl 58 Formatting for Numbers with a Decimal Point 59 Output with cerr 60 Input Using cin 69 Tip: Line Breaks in l/O 62 PROGRAM STYLE 62 Comments 63 ...
View Full 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