What is C++ ?
is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language, or “C with Classes”. The language has expanded significantly over time, and modern C++ now has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation. It is almost always implemented as a compiled language, and many vendors provide C++ compilers. C++ was designed with an orientation toward system programming and embedded, resource-constrained software and large systems, with performance, efficiency, and flexibility of use as its design highlights. C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications,including desktop applications, video games, servers (e.g. e-commerce, web search, or databases), and performance-critical applications (e.g. telephone switches or space probes).
Tokens in C++
- Identifiers: Identifiers are names given to different elements such as variables,arrays, structures, functions, classes, objects etc.It should not be keywords
- Keywords: These are reserved words used for specific purpose in a program. Keywords have fixed meaning, and its meaning cannot be changed.
- Constants are like a variable, having fixed value . Their value never changes during execution of program once they are defined.
- Strings: A sequence or a set of characters is known as a string.
- Operators: C++ operator is a symbol that is used to perform mathematical or logical operations.
Keywords in C++
Datatypes in C++
|Sr. No.||Data Type Category||Data Types|
|1||Built-in Data Types||char, wchar_t, int, long, float, double, long double|
|2||Derived Data Types||Array , Pointer|
|3||User-defined data types||Structure, Union, Class and Enumerated|
|4||Data Qualifiers / Modifiers||short, long , signed , unsigned|
Operators in C++
|Sr. No.||Type of operators||Operators|
|1||Arithmetic operators||+ – * / %|
|2||Unary operators||– ++ – –|
|3||Relational operators||< <= > >= == !=|
|4||Logical operators||! || &&|
|5||Assignment operators||= += -= *= /= %=|
|6||Conditional operator||? :|
|7||Bitwise operators||| Bitwise OR & Bitwise AND ^ Bitwise Ex-OR ~ 1’s complement << Shift Left >> Shift Right|
Variables in C++
•Variables are the name of memory locations that are allocated by compilers, and
the allocation is done based on the data type used for declaring the variable.
Decision Making Statements in C++
- if statement
- if-else statement
- Nested if-else statement
- else-if ladder statement
- switch statement
Looping Statements in C++
- while statement
- do-while Statement
- for statement
- Nested Loops
Control Statements in C++
- break statement
- continue statement
Structures in C++
•A set or a group of data items of different data types defined in a single
unit is known as a structure.
•A structure is a convenient tool for handling a group of logically related data items.
•A structure is a user defined data type
•Once the structure type has been defined, it is easy to create variables of that type
- MinGW / GCC
- Borland C++
- Dev C++
- Visual C++
- Intel C++
- Code Block
You must be logged in to post a comment.