elibraryportal Logo

What is C++

C++ is case-sensitive High level language but having Low-level facilitites. This language is based on Two existing language, namely C & Simula. C++ include the flexibility & efficency of C & the Object oriented programing features of Simula..

OOPs Concepts

C++ supports the object oriented programming(OOPs) Concepts that is

  1. Inheritance
  2. Polymorphism
  3. Encapsulation
  4. Abstraction

Where usage of C++

  • Window application
  • Client-Server application
  • Device drivers
  • Embedded firmware etc

Structure of C++ Program

C++ program structure is divided into various section, namely headers, class, defination,member functions definations and main function.

Note:- C++ provides the flexibility of writing a program with or without class. A simple C++ program(without a class) includes comments, headers, namespace, main() nad input/output statement.

Where Explain here.

  • // :- This is comments and igonerd by the compiler
  • #include <iostream>:- This is Headers
  • using namespace :- This tells the compiler to use still namespace
  • int main() :- This is mian function
  • cout << "First C++ Programming";
    return 0;
    :- This is the body of main() it contains the executable code.

1) What is Comment in C++

C++ supports two comments style that is

  1. Single line comments:- Double slash(//) is represent single line comment. Single line comments are used to define line-by-line discription.
  2. Multi line comments:- Multiline comments are used to define multiple line description and representd as

2) Explain the Headers(#include <iostream>) in C++.

The standards headers contain the information like prototype, defination and return type of library function, data type of constants, etc.

The stnadard streams deined in <iostream> are listed here.

  1. cin:- It is the standard input stram that is associated with the standard input device(keyboard) and used to take the input from users.
  2. cout:- It is the standard output stram that is associated with standard output device(monitor) and is used to display the output to user.
  3. cerr:- It is the standard error stream that is associated with the standard error device(monitor) and used to report errors to the users.
  4. clog:- It is the buffered error stream that associated with the standard error device(computer screen) and is used to report errors to user.

3) Explain the Namespace in C++.

A namespace permits grouping of various entities like classes, object ,function and various C++ token. etc. under a single name.

  1. By specifying the using directive
  2. By specifying the full member name
  3. By specifying the using declaration

4) Explain the Main Function in C++.

The main() is startup function that starts the execution of a C++ program. All C++ statements that need to be executed are written within main() . The compiler executes all the instruction written within the opening and closing curly braces'{}' that enclosed the body of main().

5) Explain the The Input/Output Operator in C++.

In C++, Input and Output operator are used to take input and display output.

Application of C++

Some of them are given here.

  1. Adobe Photoshop & ImageReady,Acrobat
  2. CAD System
  3. E-commerce software such as Amazon.com
  4. Firefox browser that is Mozila.
  5. etc.
Next TopicHistory of C++