Logo

Codcups

Complete C++ Reference's

Intro Of C++ Language

C++ is a powerful, high-performance programming language developed by Bjarne Stroustrup in 1983 as an extension of the C language. It combines the features of procedural and object-oriented programming, making it highly suitable for large-scale applications such as system/software development, game engines, real-time simulations, and embedded systems. Due to its performance and flexibility, C++ remains a foundational language in modern software development.

C++ Language Full Reference Table

📌 1. C++ Keywords

KeywordDescription
autoDeduces type automatically
boolBoolean data type
breakExit from loop or switch
caseLabel in a switch statement
catchHandles exceptions
charCharacter data type
classDeclares a class
constDeclares a constant
continueSkips current loop iteration
defaultDefault label in switch
deleteDeallocates memory
doStarts do-while loop
doubleDouble precision float
elseElse branch of if-statement
enumDeclares enumeration
explicitUsed to avoid implicit conversions
exportUsed for exporting templates
externDeclares external linkage
falseBoolean false value
floatFloating point data type
forLoop structure
friendGrants access to private members
gotoJumps to labeled statement
ifConditional branch
inlineSuggests inlining function
intInteger data type
longLong integer
mutableAllows member to be modified in const obj
namespaceEncapsulates identifiers
newAllocates memory
operatorOverloads operator
privatePrivate access specifier
protectedProtected access specifier
publicPublic access specifier
registerRegisters variable (hint)
reinterpret_castCasts pointer to different type
returnReturns from a function
shortShort integer
signedSigned modifier
sizeofReturns size in bytes
staticStatic lifetime
structDeclares structure
switchMulti-way branch
templateDeclares templates
thisPointer to current object
throwThrows exception
trueBoolean true value
tryStarts exception handler
typedefCreates alias for type
typeidReturns type information
typenameIndicates type name in templates
unionDeclares union
unsignedUnsigned modifier
usingImports names from namespace
virtualDeclares virtual function
voidNo return value or type
volatilePrevents optimization
wchar_tWide character type
whileLoop with condition at top
static_castPerforms explicit conversion
dynamic_castSafely casts in polymorphic class hierarchy

📌 2. C++ Data Types

TypeDescription
intInteger
charCharacter
floatFloating point
doubleDouble precision float
boolBoolean (true/false)
voidNo value
wchar_tWide character
shortShort integer
longLong integer
unsignedPositive-only integer variants

📌 3. C++ Operators

Operator TypeOperators
Arithmetic+ - * / %
Assignment= += -= *= /= %=
Increment/Decrement++ --
Comparison== != > < >= <=
Logical&& || !
Bitwise& | ^ ~ << >>
Compound Assignment&= |= ^= <<= >>=
Ternary? :
Scope Resolution::
Member Access. ->
Pointer* &
Type Caststatic_cast, dynamic_cast, etc.

📌 4. Modifiers

ModifierDescription
signedCan hold negative and positive
unsignedOnly positive values
shortReduces memory usage
longExtends memory size

📌 5. Control Structures

StructureDescription
if / elseConditional logic
switchMulti-case logic
forLoop with init-condition-update
whileEntry-controlled loop
do...whileExit-controlled loop
breakExit loop/switch
continueSkip current iteration
gotoJumps to labeled location
returnExits function

📌 6. Preprocessor Directives

DirectiveUse
#includeInclude header files
#defineDefine macros
#undefUndefine macros
#ifdefIf defined
#ifndefIf not defined
#endifEnds conditional directive
#if / #elseConditional compilation
#pragmaSpecial compiler instructions
#errorThrows compilation error
#lineChanges line number for errors

📌 7. Special Symbols & Characters

SymbolMeaning
{ }Block of code
[ ]Array brackets
( )Function call or grouping
;Statement terminator
" "String literal
' 'Character literal
\\Escape character
//Single-line comment
/* */Multi-line comment

Click to go back on notes page.