beginning with c++ by hardeep singh - cloud object storage · it is an object oriented programming....

13
Beginning with C++ By Hardeep Singh By Hardeep Singh

Upload: lamtuyen

Post on 24-Jun-2018

225 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Beginning with C++

By Hardeep Singh

By Hardeep Singh

Page 2: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Contents

What is C++?

Applications of C++.

Simple Program Features.

Comments

Output Operator

By Hardeep Singh

Page 3: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Contents Conti..

Header Files

Return Type of main( )

More C++ Statements

An example With Class

Structure of C++ Program

By Hardeep Singh

Page 4: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

What is C++?

It is an object oriented programming.

It is the super set of c.

It has bottom-up approach.

Applications:-

By Hardeep Singh

Page 5: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Simple C++ program

#include< iostream.h >

#include< conio.h >

int main( )

{

cout<<“c++ is better than c”<<endl;

getch( );

return 0;

}

By Hardeep Singh

Page 6: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Comments

C++ introduced a new comment symbol

//(back slash).

It is of 2 types:-

1. Single line comments

2. Multi line comments

By Hardeep Singh

Page 7: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Input & Output Operator

The operator >> is called the extraction operator. It is

used for output.

The operator << is known as insertion operator. It is

used for input .

By Hardeep Singh

Page 8: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Header Files

<stdio.h>

<iostream.h>

<stdlib.h>

<string.h>

<time.h>

<iomanip.h>

<fstream>

By Hardeep Singh

Page 9: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Namespace

All classes and functions are declared within

namespace.

Using namespace specifies that the members

defined in std are used throughout

the program.

By Hardeep Singh

Page 10: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Return Type of main( )

By default the return type of main( ) is integer.

Therefore the return type of all functions

in c++ is int.

By Hardeep Singh

Page 11: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

More C++ Statements

Variables

Cascading of I/O operator

By Hardeep Singh

Page 12: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

Structure of C++ Program

Include files

Class declaration

Member functions definition

Main function program

By Hardeep Singh

Page 13: Beginning with C++ By Hardeep Singh - Cloud Object Storage · It is an object oriented programming. ... in c++ is int. By Hardeep Singh . ... -Object oriented programming with C++

References

Book:-Object oriented programming with C++

Author name:- E Balagurusamy

Edition:- Second

Chapter- Second

Page no:- form 17-29

By Hardeep Singh