fbpx

History of c++ and Sample program of c++


INTRODUCTION

C++ is a versatile, middle-level programming language that bridges the gap between low-level and high-level programming. It was developed by Bjarne Stroustrup at Bell Telephone Laboratories as an extension of the C language. Initially called “C with Classes,” it introduced features like inheritance, type checking, and default function arguments, eventually becoming the powerful C++ we know today.

C++ is an object-oriented programming language. It is a middle-level language. Combining features of both low-level and high-level programming.

It was created, designed, and developed by Danish computer scientist Bjarne Stroustrup at Bell Telephone Laboratories

 Stroustrup aimed to develop a flexible and dynamic language similar to C, incorporating its features but enhancing it with active type checking, basic inheritance, default function arguments, classes, inlining, and more. This effort led to the creation of “C with Classes,” later known as C++.

History of c++

  • c++ is the mostly used language for competitive programming mainly because of its stl.
  • short for standard template library, the stl is a collection of c++ templates to help programmers quickly tackle basic data structures and functions such as lists, stacks, arrays, etc.
  • supports operator overloading
  • supports multiple inheritance.
  • Ability to modularize the code the encapsulation and polymorphism.

//first helloworld c program

#include<iostream.h> // header file

using namespace std;

int main()

{

cout<<”hello world”;

return 0;

}

What does the header file consists of 

The statement using namespace std;

is commonly used in C++ programs to simplify the code by allowing direct access to the standard library functions and objects without prefixing them with std::. However, there’s no standard namespace named ltd in C++. If you meant std, here’s an explanation:

A header file in C++ consists of declarations that allow you to share functions, classes, macros, constants, and variables across multiple source files.

 It does not typically contain function definitions or implementations (except for inline and template functions). Here’s what a header file usually includes:

C++ is an intermediate-level language; learning this language will give you a much deeper understanding of programming structure. In C++, you have to write, declare, and explain everything in the source code.