C++ is a powerful, general-p
language known for its perfor
It's widely used in a variety
operating systems to game dev
, What is C++?
C++ is a compiled, statically typed language with a
rich set of features. It allows developers to control
system resources and memory management directly,
providing high performance and efficiency.
Object-Oriented General Purpose
C++ supports object- It is used for a wide range
oriented programming, of applications, from game
allowing you to design and development to operating
build modular, reusable systems.
code.
Performance
C++ is known for its speed and efficiency,
making it suitable for performance-critical
applications.
,The Format of a C++ Program
1. A main function
2. Variable declarations
3. Executable statements
1. A main function
this is the function that will be executed,
so this is where you will write your
program statements. The contents of the
main function are enclosed in curly
brackets { }
, 2. Variable declarations
C++ is a strongly-typed language, and requires every
variable to be declared with its type before its first
use.
This informs the compiler the size to reserve in
Memory for the variable and how to interpret its
value.
The syntax to declare a new variable in C++ is
straightforward: we simply write the type followed
by the variable name (i.e., its identifier).
For example:
Eg . Int x;
float y;
char ‘h’;