Introduction to C++ Programming: Features, History, and Basics, Slides of Object Oriented Programming

An introduction to C++ programming, covering its history, features, and basic concepts. C++ is a general-purpose, object-oriented programming language that supports procedural and generic programming. It was developed by Bjarne Stroustrup in 1980 as an extension of the C language, adding object-oriented programming features. the advantages of C++, its history, and its features, such as simplicity, machine independence, mid-level programming, structured programming, rich library, memory management, speed, pointers, recursion, and extensibility.

Typology: Slides

2019/2020

Uploaded on 03/03/2020

basharat-sahito
basharat-sahito 🇵🇰

1 document

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Fundamental Programming
Lecture N0 1
By
Muhammad Shahabz
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download Introduction to C++ Programming: Features, History, and Basics and more Slides Object Oriented Programming in PDF only on Docsity!

Fundamental Programming

Lecture N0 1 By Muhammad Shahabz

What is C++

  • (^) C++ is a general purpose, case-sensitive, free- form programming language that supports object-oriented, procedural and generic programming.
  • (^) C++ is a middle-level language, as it encapsulates both high and low level language features.

Standard Libraries Standard C++ programming is divided into three important parts:

  • (^) The core library includes the data types, variables and literals, etc.
  • (^) The standard library includes the set of functions manipulating strings, files, etc.
  • (^) The Standard Template Library (STL) includes the set of methods manipulating a data structure.

Usage of C++ By the help of C++ programming language, we can develop different types of secured and robust applications:

  • (^) Window application
  • (^) Client-Server application
  • (^) Device drivers
  • (^) Embedded firmware etc

C++ history History of C++ language is interesting to know. Here we are going to discuss brief history of C++ language. C++ programming language was developed in 1980 by Bjarne Stroustrup at bell laboratories of AT&T (American Telephone & Telegraph), located in U.S.A.

C++ History…

Bjarne Stroustrup is known as the **founder of C+

  • language.** It was develop for adding a feature of OOP (Object Oriented Programming) in C without significantly changing the C component. C++ programming is "relative" (called a superset) of C, it means any valid C program is also a valid C++ program.

C++ Features

C++ Features …

  1. Simple C++ is a simple language in the sense that it provides structured approach (to break the problem into parts), rich set of library functions, data types etc.
  2. Machine Independent or Portable Unlike assembly language, c programs can be executed in many machines with little bit or no change. But it is not platform-independent.

C++ Features …

  1. Rich Library C++ provides a lot of inbuilt functions that makes the development fast.
  2. Memory Management It supports the feature of dynamic memory allocation. In C++ language, we can free the allocated memory at any time by calling the free() function.
  3. Speed The compilation and execution time of C++ language is fast.

C++ Features …

  1. Pointer C++ provides the feature of pointers. We can directly interact with the memory by using the pointers. We can use pointers for memory, structures, functions, array etc.
  2. Recursion In C++, we can call the function within the function. It provides code reusability for every function.
  3. Extensible C++ language is extensible because it can easily adopt new features.

C++ Program

Before starting the abcd of C++ language, you need to learn how to write, compile and run the first C++ program. To write the first C++ program, open the C++ console and write the following code: #include <iostream.h> Using namespace std; void main() { cout << "Welcome to C++ Programming."; system(“pause”); }

Continue…

#include<iostream.h> includes the standard input output library functions. It provides cin and cout methods for reading from input and writing to output respectively void main() The main() function is the entry point of every program in C++ language. The void keyword specifies that it returns no value.

I/O Library Header Files

Standard output stream (cout)  (^) The cout is a predefined object of ostream class. It is connected with the standard output device, which is usually a display screen. The cout is used in conjunction with stream insertion operator (<<) to display the output on a console  (^) Let's see the simple example of standard output stream (cout): #include using namespace std; int main( ) { char ary[] = "Welcome to C++ tutorial"; cout << "Value of ary is: " << ary << endl; }