Notes – Introduction to C++

C++ is a powerful, high-performance programming language that supports both procedural and object-oriented programming (OOP).

It is widely used in system programming, game development, embedded systems, and real-time applications.


Origin of C++

  • Developed by Bjarne Stroustrup in the early 1980s at Bell Labs
  • Initially called “C with Classes
  • Later renamed to C++, where ++ symbolizes an enhancement over C

Features of C++


FeatureDescription
Object-OrientedSupports classes, objects, inheritance, polymorphism
Compiled LanguageCode is compiled into machine code before execution
Platform IndependentCode can be compiled on different operating systems
Low & High-LevelCombines low-level memory control with high-level features
Strong Type CheckingReduces runtime errors through compile-time checks

How is C++ Different from C?


AspectCC++
ProgrammingProceduralMulti-paradigm (OOP + Procedural)
Data HandlingUses functions onlySupports classes and objects
EncapsulationNot supportedFully supported
Code ReuseLimitedSupports inheritance

Applications of C++

  • Operating systems and device drivers
  • Embedded systems
  • Game engines and 3D graphics
  • Financial and banking software
  • Real-time simulations

Sample Hello World Program

#include <iostream>
using namespace std;

int main() {
cout << "Hello, C++!" << endl;
return 0;
}

Explanation:

  • #include <iostream> โ€“ used for input/output
  • main() โ€“ starting point of execution
  • cout โ€“ prints output to screen
  • return 0; โ€“ ends the program