lecture-4 - Introduction to C+ Object Oriented Programming...

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

View Full Document Right Arrow Icon
Object Oriented Programming – Introduction to C++ R.B. Lenin Winter 2006 DA-IICT Introduction to C++
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Object Oriented Programming – Introduction to C++ R.B. Lenin Winter 2006 DA-IICT C++ As A "Better C" Outline Introduction C++ A Simple Program: Adding Two Integers C++ Standard Library Header Files Inline Functions References and Reference Parameters Default Arguments and Empty Parameter Lists Unary Scope Resolution Operator Function Overloading Function Templates
Background image of page 2
3 Object Oriented Programming – Introduction to C++ R.B. Lenin Winter 2006 DA-IICT C++ •C + + – Improves on many of C's features – Has object-oriented capabilities • Increases software quality and reusability – Developed by Bjarne Stroustrup at Bell Labs • Called "C with classes" • C++ (increment operator) - enhanced version of C – Superset of C • Can use a C++ compiler to compile C programs • Gradually evolve the C programs to C++ • ANSI C++ – Final version at http://www.ansi.org/ – Free, older version at http://www.cygnus.com/misc/wp/
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Object Oriented Programming – Introduction to C++ R.B. Lenin Winter 2006 DA-IICT A Simple Program: Adding Two Integers • File extensions – C files: .c – C++ files: .cpp (which we use), .cxx , .C (uppercase) • Differences – C++ allows you to "comment out" a line by preceding it with // For example: // text to ignore <iostream> - input/output stream header file – Return types - all functions must declare their return type • C does not require it, but C++ does – Variables in C++ can be declared almost anywhere • In C, required to declare variables in a block, before any executable statements
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

lecture-4 - Introduction to C+ Object Oriented Programming...

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

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