Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

MC 0066 (B)

Advanced Concepts of OOPs using C++


Contents
Unit 1
Inheritance, Virtual Functions, and Polymorphism
– Revised 1
Unit 2
This Pointer, Friends, and Static Functions 25
Unit 3
The Iostream Library 41
Unit 4
Templates 87
Unit 5
Exception Handling 116
Unit 6
Standard Template Library 139
Unit 7
Introduction to UML 200
Edition: Fall 2007

th
BKID – B0715 17 July 2007
Brig. (Dr). R. S. Grewal VSM (Retd.)
Pro Vice Chancellor
Sikkim Manipal University of Health, Medical & Technological Sciences

Board of Studies
1. Mr. Raju BPG 4. Dr. Karuppu Samy
Convener GM – Embedded Intelligence
Manipal Universal Learning Jupiter Strategic
Bangalore Technologies Ltd., Bangalore
2. Mr. Sunil Kumar Pandey 5. Mr. Harishchandra Hebbar
Asst. Prof. – Department of IT and CA Director – MCIS
Sikkim Manipal University – DDE Manipal
Manipal
3. Dr. N. V. Subba Reddy 6. Mr. Arun C. Mudhol
Professor & HOD – Department of CS&E Solutions Oriented Professional
MIT, Manipal IT Consultant, Bangalore

Content Development
1. Mr. Vittaldas Prabhu
Dept. of ICT, MIT Campus, Manipal

Concept Design & Editing


1. Mr. Mamatha Balachandra 2. Mr. C. V. Uppin
CSE Dept, MIT, Manipal SMU – DDE Manipal

Edition: Fall 2007

 Manipal Universal Learning Pvt. Ltd., Manipal – 576 104


This book is a distance education module comprising a collection of learning
material for our students.
All rights reserved. No part of this work may be reproduced in any form,
by mimeography or any other means, without permission in writing from Sikkim –
Manipal University, Gangtok, Sikkim.
Printed and Published on behalf of Sikkim – Manipal University, Gangtok, Sikkim by
Mr. Rajkumar Mascreen, GM, Manipal Universal Learning Pvt. Ltd.
Printed at Manipal Press Limited, Manipal.
SUBJECT INTRODUCTION
C++ is a general-purpose, middle-level programming language with high-
level and low-level capabilities. It is a statically typed free-form multi-
paradigm language, supporting procedural programming, data abstraction,
object-oriented programming, and generic programming. Since the 1990s,
C++ has been one of the most popular commercial programming languages.
The term middle-level does not imply that C++ is less powerful, harder to
use, or less developed than high-level languages, nor that it has the
cumbersome nature of low-level languages. Rather it combines the best
elements of high-level languages with the flexibility of assembly language.
The intention of having this book is to provide a detailed description of a few
advanced concepts in C++ that may be used in our daily lives to write better
programs than before.

Unit 1 – Inheritance, Virtual Functions, and Polymorphism – Revisited:


The purpose of this unit is to revisit some of the concepts of C++, i.e., to
brush-up the readers fundamentals on Inheritance, Virtual Functions, and
Polymorphism. This unit should be able to drive the reader to hunt for more
knowledge on the concepts touched upon.

Unit 2 – This pointer, Friends and Static Functions:


The primary focus of this unit is to introduce some of the miscellaneous, yet
handy, features of C++, i.e., this pointer, friends (friend classes and
functions), and static functions. All the concepts are described with relevant
examples to better understand the concepts.

Unit 3 – Files and Streams:


This unit describes in detail the very useful and featureful iostream library
offered by C++. This unit is studded with examples that will help the reader
in understanding the concept of file I/O with streams. This unit also helps the
reader in understanding how he/she may be able to organize (format) output
using manipulators.
Unit 4 – Templates:
Templates are a very useful and extremely indispensable feature of C++. A
lot of programming effort can be saved by the use of templates. This unit
describes templates, template programming, and the usage considerations
of templates, with the help of a myriad of examples to illustrate the
concepts.

Unit 5 – Exception Handling:


Every programmer describes his/her program to be error-free. But errors still
pop up. How to gracefully handle these errors (or exceptions) is what
exception handling is all about. This unit comprehensively describes
exception handling along with useful examples. This unit also introduces the
readers to standard exceptions, and also teaches how to create user-
defined exceptions.

Unit 6 – Standard Template Library:


Another step towards efficient programming is achieved by the use of
Standard Template Library (STL). This unit introduces the reader to STL.
Furthermore, this unit provides minute details on all of the STL components
with relevant examples to show how these components can be used in
programs.

Unit 7 – Introduction to UML:


UML or Unified Modeling Language is a Object Oriented Analysis and
Design (OOAD) tool. UML is not tied up with C++ as such, but is a generic
design language using which software-intensive systems may be designed
and implemented. This unit will introduce the reader to the novel idea of
OOAD using UML, the feature-rich components of UML. This unit should
drive the reader in designing better and efficient software systems.

You might also like