SlideShare a Scribd company logo
INTRODUCTION TO
C++
INTRODUCTION TO
BY ASIRBACHAN
C++ Character Set
Letters A-Z, a-z
Digits 0-9
Special Characters
Space + -
* / ^  () [] {} = != <> ‘ “ $ , ; :
% ! & ? _ # <= >= @
Formatting characters
backspace, horizontal tab, vertical tab,
form feed, and carriage return
Character set is a set of valid characters that a language can recognize.
Tokens
A token is a group of characters that logically belong together.
The programmer can write a program by using tokens. C++ uses the following types of tokens.
Keywords, Identifiers, Literals, Punctuators, Operators.
SUBJECT VERB OBJECT
#include <iostream>
void main()
cout<< “hello world” ;
{
}
Like a sentence has parts of speeches used in it.
In the same way C++ statements are made of
tokens.
Keywords
These are some reserved words in C++ which have predefined meaning to compiler called keywords.
BOTTLEBAG
Everything in this world has a specific name. You
cannot call it by any other name. This is what exists in
C++ also. There are words in C++ with predefined
meanings and cannot be represented by any other
word.
Identifiers
Symbolic names can be used in C++ for various data items used by a programmer in his program. A
symbolic name is generally known as an identifier. The identifier is a sequence of characters taken from
C++ character set. The rule for the formation of an identifier are:
 An identifier can consist of alphabets, digits and/or underscores.
 It must not start with a digit
 C++ is case sensitive that is upper case and lower case letters are considered different from each
other.
 It should not be a reserved word.
Identifiers are words that deal with memory location.
When we declare a variable it is called as identifier.
Example: 1 int number;
2 cin>> number;
3 cout<< number;
Literals
Literals (often referred to as constants) are data items that never change their value during the
execution of the program. The following types of literals are available in C++.
 Integer-Constants
 Character-constants
 Floating-constants
 Strings-constants
 Bool-constants
‘a’
“Manoeuvre”
67
-5.09
NOTE: The literals are fixed. They do not change values like variables.
1 or 0
Integer Constants
Integer constants are whole number without any fractional part. C++ allows three types of integer
constants.
Decimal integer constants : It consists of sequence of digits and should not begin with 0 (zero). For
example 124, - 179, +108.
Octal integer constants: It consists of sequence of digits starting with 0 (zero). For example. 014,
012.
Hexadecimal integer constant: It consists of sequence of digits preceded by ox or OX.
Character constants
A character constant in C++ must contain one or more characters and must be enclosed in single
quotation marks. For example 'A', '9', etc. C++ allows nongraphic characters which cannot be typed
directly from keyboard, e.g., backspace, tab, carriage return etc. These characters can be
represented by using an escape sequence. An escape sequence represents a single character.
Floating constants
They are also called real constants. They are numbers having fractional parts. They may be written
in fractional form or exponent form. A real constant in fractional form consists of signed or unsigned
digits including a decimal point between digits. For example 3.0, -17.0, -0.627 etc.
String Literals
A sequence of character enclosed within double quotes is called a string literal. String literal is by
default (automatically) added with a special character ‘0' which denotes the end of the string.
Therefore the size of the string is increased by one character. For example "COMPUTER" will re
represented as "COMPUTER0" in the memory and its size is 9 characters.
BoolLiterals
The bool literal is used to represent one of the two Boolean values ie. 1 for true and 0 for false.
Brackets [ ]
Opening and closing brackets indicate single and
multidimensional array subscript.
Parentheses ( )
Opening and closing brackets indicate functions
calls,; function parameters for grouping
expressions etc.
Braces { }
Opening and closing braces indicate the start and
end of a compound statement.
Comma ,
It is used as a separator in a function argument
list.
Semicolon ; It is used as a statement terminator.
Colon :
It indicates a labeled statement or conditional
operator symbol.
Asterisk *
It is used in pointer declaration or as
multiplication operator.
Equal sign = It is used as an assignment operator.
Pound sign # It is used as pre-processor directive.
{Punctuators}; The following characters are used as punctuators in C++.
Operators are special symbols used for specific purposes. C++ provides six types of
operators. Mainly they are classified into Unary and binary operators. Subdivisions:
Arithmetical operators, Relational operators, Logical operators, Unary operators, Assignment
operators, Conditional operators, Comma operator
Operators
+ - * / %
>> == << >= <=
Unary Operators
Unary operators are those that require one operator to operate upon.
Binary Operators
Binary operators are those operators that require two operands to operate
& * + - ~ ++ -- !
+ - * / %
Arithmetic operators
Address
Operator
Indirection
Operator
Unary
Plus
Unary
Minus
Bitwise
Complement
Increment
Operator
Decrement
Operator
Logical
Negation
Add Subtract Multiply Divide Remainder
<< >>
Shift operators
Shift Left Shift Right
&& ||
Logical operators
Logical AND Logical OR
< > <= >= == !=
Relational operators
Less than Equal toGreater than Less than = Greater than = Not equal to

More Related Content

What's hot

02. chapter 3 lexical analysis
02. chapter 3   lexical analysis02. chapter 3   lexical analysis
02. chapter 3 lexical analysis
raosir123
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
K Durga Prasad
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
Bussines man badhrinadh
 
C tokens
C tokensC tokens
C tokens
Manu1325
 
Fundamentals of c programming
Fundamentals of c programmingFundamentals of c programming
Fundamentals of c programming
Chitrank Dixit
 
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Unit ii ppt
Unit ii pptUnit ii ppt
Python Programming
Python ProgrammingPython Programming
Python Programming
Saravanan T.M
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
Qazi Shahzad Ali
 
CSharp Language Overview Part 1
CSharp Language Overview Part 1CSharp Language Overview Part 1
CSharp Language Overview Part 1
Hossein Zahed
 
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
SowmyaJyothi3
 
c++
 c++  c++
Lecture 13 intermediate code generation 2.pptx
Lecture 13 intermediate code generation 2.pptxLecture 13 intermediate code generation 2.pptx
Lecture 13 intermediate code generation 2.pptx
Iffat Anjum
 
C language basics
C language basicsC language basics
C language basics
Nikshithas R
 
C++ programming
C++ programmingC++ programming
C++ programming
Anshul Mahale
 
Diploma ii cfpc u-2 datatypes and variables in c language
Diploma ii  cfpc u-2 datatypes and variables in c languageDiploma ii  cfpc u-2 datatypes and variables in c language
Diploma ii cfpc u-2 datatypes and variables in c language
Rai University
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
DataminingTools Inc
 
Bsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c languageBsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c language
Rai University
 
Tokens expressionsin C++
Tokens expressionsin C++Tokens expressionsin C++
Tokens expressionsin C++
HalaiHansaika
 
BASIC C++ PROGRAMMING
BASIC C++ PROGRAMMINGBASIC C++ PROGRAMMING
BASIC C++ PROGRAMMING
gufranresearcher
 

What's hot (20)

02. chapter 3 lexical analysis
02. chapter 3   lexical analysis02. chapter 3   lexical analysis
02. chapter 3 lexical analysis
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
C tokens
C tokensC tokens
C tokens
 
Fundamentals of c programming
Fundamentals of c programmingFundamentals of c programming
Fundamentals of c programming
 
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
 
Unit ii ppt
Unit ii pptUnit ii ppt
Unit ii ppt
 
Python Programming
Python ProgrammingPython Programming
Python Programming
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
CSharp Language Overview Part 1
CSharp Language Overview Part 1CSharp Language Overview Part 1
CSharp Language Overview Part 1
 
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
 
c++
 c++  c++
c++
 
Lecture 13 intermediate code generation 2.pptx
Lecture 13 intermediate code generation 2.pptxLecture 13 intermediate code generation 2.pptx
Lecture 13 intermediate code generation 2.pptx
 
C language basics
C language basicsC language basics
C language basics
 
C++ programming
C++ programmingC++ programming
C++ programming
 
Diploma ii cfpc u-2 datatypes and variables in c language
Diploma ii  cfpc u-2 datatypes and variables in c languageDiploma ii  cfpc u-2 datatypes and variables in c language
Diploma ii cfpc u-2 datatypes and variables in c language
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
 
Bsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c languageBsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c language
 
Tokens expressionsin C++
Tokens expressionsin C++Tokens expressionsin C++
Tokens expressionsin C++
 
BASIC C++ PROGRAMMING
BASIC C++ PROGRAMMINGBASIC C++ PROGRAMMING
BASIC C++ PROGRAMMING
 

Similar to Getting started with C++

C++
C++C++
C tokens.pptx
C tokens.pptxC tokens.pptx
C tokens.pptx
NavyaParashir
 
1 Revision Tour
1 Revision Tour1 Revision Tour
1 Revision Tour
Praveen M Jigajinni
 
Object Oriented Programming with C++
Object Oriented Programming with C++Object Oriented Programming with C++
Object Oriented Programming with C++
Rokonuzzaman Rony
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
Rai University
 
Ch02
Ch02Ch02
Mca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageMca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c language
Rai University
 
Btech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c languageBtech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c language
Rai University
 
C Token’s
C Token’sC Token’s
C Token’s
Tarun Sharma
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
Ashwini Rao
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
MamataAnilgod
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
Mohit Saini
 
2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++
Kuntal Bhowmick
 
Basics of c
Basics of cBasics of c
Basics of c
vinothini1996
 
Fundamentals of C Programming Language
Fundamentals of C Programming LanguageFundamentals of C Programming Language
Fundamentals of C Programming Language
RamaBoya2
 
PROGRAMMING IN C - Inroduction.pptx
PROGRAMMING IN C - Inroduction.pptxPROGRAMMING IN C - Inroduction.pptx
PROGRAMMING IN C - Inroduction.pptx
Nithya K
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
JAYA
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
MOHAMAD NOH AHMAD
 
Basic Programming of c++
Basic Programming of c++Basic Programming of c++
Basic Programming of c++
MMAbdullah17
 
C Slides
C SlidesC Slides

Similar to Getting started with C++ (20)

C++
C++C++
C++
 
C tokens.pptx
C tokens.pptxC tokens.pptx
C tokens.pptx
 
1 Revision Tour
1 Revision Tour1 Revision Tour
1 Revision Tour
 
Object Oriented Programming with C++
Object Oriented Programming with C++Object Oriented Programming with C++
Object Oriented Programming with C++
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
Ch02
Ch02Ch02
Ch02
 
Mca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageMca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c language
 
Btech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c languageBtech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c language
 
C Token’s
C Token’sC Token’s
C Token’s
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
 
2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++
 
Basics of c
Basics of cBasics of c
Basics of c
 
Fundamentals of C Programming Language
Fundamentals of C Programming LanguageFundamentals of C Programming Language
Fundamentals of C Programming Language
 
PROGRAMMING IN C - Inroduction.pptx
PROGRAMMING IN C - Inroduction.pptxPROGRAMMING IN C - Inroduction.pptx
PROGRAMMING IN C - Inroduction.pptx
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Basic Programming of c++
Basic Programming of c++Basic Programming of c++
Basic Programming of c++
 
C Slides
C SlidesC Slides
C Slides
 

Recently uploaded

RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 

Recently uploaded (20)

RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 

Getting started with C++

  • 2. C++ Character Set Letters A-Z, a-z Digits 0-9 Special Characters Space + - * / ^ () [] {} = != <> ‘ “ $ , ; : % ! & ? _ # <= >= @ Formatting characters backspace, horizontal tab, vertical tab, form feed, and carriage return Character set is a set of valid characters that a language can recognize.
  • 3. Tokens A token is a group of characters that logically belong together. The programmer can write a program by using tokens. C++ uses the following types of tokens. Keywords, Identifiers, Literals, Punctuators, Operators. SUBJECT VERB OBJECT #include <iostream> void main() cout<< “hello world” ; { } Like a sentence has parts of speeches used in it. In the same way C++ statements are made of tokens.
  • 4. Keywords These are some reserved words in C++ which have predefined meaning to compiler called keywords. BOTTLEBAG Everything in this world has a specific name. You cannot call it by any other name. This is what exists in C++ also. There are words in C++ with predefined meanings and cannot be represented by any other word.
  • 5. Identifiers Symbolic names can be used in C++ for various data items used by a programmer in his program. A symbolic name is generally known as an identifier. The identifier is a sequence of characters taken from C++ character set. The rule for the formation of an identifier are:  An identifier can consist of alphabets, digits and/or underscores.  It must not start with a digit  C++ is case sensitive that is upper case and lower case letters are considered different from each other.  It should not be a reserved word. Identifiers are words that deal with memory location. When we declare a variable it is called as identifier. Example: 1 int number; 2 cin>> number; 3 cout<< number;
  • 6. Literals Literals (often referred to as constants) are data items that never change their value during the execution of the program. The following types of literals are available in C++.  Integer-Constants  Character-constants  Floating-constants  Strings-constants  Bool-constants ‘a’ “Manoeuvre” 67 -5.09 NOTE: The literals are fixed. They do not change values like variables. 1 or 0
  • 7. Integer Constants Integer constants are whole number without any fractional part. C++ allows three types of integer constants. Decimal integer constants : It consists of sequence of digits and should not begin with 0 (zero). For example 124, - 179, +108. Octal integer constants: It consists of sequence of digits starting with 0 (zero). For example. 014, 012. Hexadecimal integer constant: It consists of sequence of digits preceded by ox or OX. Character constants A character constant in C++ must contain one or more characters and must be enclosed in single quotation marks. For example 'A', '9', etc. C++ allows nongraphic characters which cannot be typed directly from keyboard, e.g., backspace, tab, carriage return etc. These characters can be represented by using an escape sequence. An escape sequence represents a single character.
  • 8. Floating constants They are also called real constants. They are numbers having fractional parts. They may be written in fractional form or exponent form. A real constant in fractional form consists of signed or unsigned digits including a decimal point between digits. For example 3.0, -17.0, -0.627 etc. String Literals A sequence of character enclosed within double quotes is called a string literal. String literal is by default (automatically) added with a special character ‘0' which denotes the end of the string. Therefore the size of the string is increased by one character. For example "COMPUTER" will re represented as "COMPUTER0" in the memory and its size is 9 characters. BoolLiterals The bool literal is used to represent one of the two Boolean values ie. 1 for true and 0 for false.
  • 9. Brackets [ ] Opening and closing brackets indicate single and multidimensional array subscript. Parentheses ( ) Opening and closing brackets indicate functions calls,; function parameters for grouping expressions etc. Braces { } Opening and closing braces indicate the start and end of a compound statement. Comma , It is used as a separator in a function argument list. Semicolon ; It is used as a statement terminator. Colon : It indicates a labeled statement or conditional operator symbol. Asterisk * It is used in pointer declaration or as multiplication operator. Equal sign = It is used as an assignment operator. Pound sign # It is used as pre-processor directive. {Punctuators}; The following characters are used as punctuators in C++.
  • 10. Operators are special symbols used for specific purposes. C++ provides six types of operators. Mainly they are classified into Unary and binary operators. Subdivisions: Arithmetical operators, Relational operators, Logical operators, Unary operators, Assignment operators, Conditional operators, Comma operator Operators + - * / % >> == << >= <=
  • 11. Unary Operators Unary operators are those that require one operator to operate upon. Binary Operators Binary operators are those operators that require two operands to operate & * + - ~ ++ -- ! + - * / % Arithmetic operators Address Operator Indirection Operator Unary Plus Unary Minus Bitwise Complement Increment Operator Decrement Operator Logical Negation Add Subtract Multiply Divide Remainder
  • 12. << >> Shift operators Shift Left Shift Right && || Logical operators Logical AND Logical OR < > <= >= == != Relational operators Less than Equal toGreater than Less than = Greater than = Not equal to