SlideShare a Scribd company logo
1 of 22
C++ INTRODUCTION AND TOKENS Made by:                                              RAFIYA SIRIN                                                     XI-B
C++ INTRODUCTION C++ was developed by Bjarne Stroustrup of AT&T Bell Laboratories in the early 1980's, and is based on the C language. The name is a pun - "++" is a syntactic construct used in C  and C++ is intended as an incremental improvement of C. Most of C is  subset of C++, so that most C programs can be compiled (i.e. converted into a series of low-level instructions that the computer can execute directly) using a C++ compiler. The name C++ was coined by Rick Mascitti. Ever since it’s birth it has coped up with problems encountered by users, and through discussions at AT&T. however the maturation of the C++ language is attested to by two recent events: (i) the formation of American National Standard Institute) C++ committee  (ii) the publication of The Annotated C++ Reference Manual by Ellis and Stroustrup.
Because C++ retains C as a subset, it gains many of the attractive features of the C language, such as efficiency, closeness to the machine, and a variety of built-in types. A number of new features were added to C++ to make the language even more robust, many of which are not used by novice programmers. By introducing these new features here, we hope that you will begin to use them in your own programs early on and gain their benefits. Some of the features we will look at are the role of constants, inline expansion, references, declaration statements, user defined types, overloading, and the free store.
THE SMALLEST INDIVIDUAL UNIT IN A PROGRAM IS KNOWN AS A TOKEN OR A LEXICAL UNIT TOKENS
KEYWORDS IDENTIFIERS TOKENS LITERALS PUNCTUATORS OPERATORS
KEYWORDS In computer programming, a keyword is a word or identifier that has a particular meaning to the programming language. The meaning of keywords — and, indeed, the meaning of the notion of keyword — differs widely from language to language.   In many languages, such as C and similar environments like C++, a keyword is a reserved word which identifies a syntactic form. Words used in control flow constructs, such as if, then, and else are keywords. In these languages, keywords can also be used as the names of variables or functions.
C++ KEYWORDS
IDENTIFIERS In computer science, Identifiers (IDs) are lexical tokens that name entities. The concept is analogous to that of a "name." Identifiers are used extensively in virtually all information processing systems. Naming entities makes it possible to refer to them, which is essential for any kind of symbolic processing. Computer languages usually place restrictions on what characters may appear in an identifier. For example, in early versions the C and C++ language, identifiers are restricted to being a sequence of one or more ASCII letters, digits (these may not appear as the first character), and underscores. Later versions of these languages, along with many other modern languages support almost all Unicode characters in an identifier (a common restriction is not to permit white space characters and language operators).
RULES FOR DETERMING AN IDENTIFIER First character must be a letter After that any combination of letters and digits can be taken. Only underscore can be included and must be treated as a letter. Keywords cannot be used as identifiers.
SOME VALID AND INVALID IDENTIFIERS VALID:- My file      DATE9_7_77      Z2T0Z9                 MYFILE       _DS                 _HJI3_JK                 _CHK            FILE13 INVALID:- DATA-REC    contains special character                       29CLCT         starting with a digit                       break           reserved keyword                        My.file        contains special character
LITERALS In computer science, a literal is a notation for representing a fixed value in source code. Almost all programming languages have notations for atomic values such as integers, floating-point numbers, strings, and Booleans; some also have notations for elements of enumerated types and compound values such as arrays, records, and objects.  Literals are divided into four types: integer-constant  character- constant Floating constant String-literal
INTEGER CONSTANTS They are whole numbers without any fractional parts. the method of writing integer constants has been specified in following rule:-  an integer constant must have at least one digit and must not contain any decimal point. It may contain either + or – sign. A number with no sign is assumed to be positive. Commas cannot appear in an integer constant. This again has three types: (i)decimal(base 10) (ii)octal(base 8) (iii)hexadecimal(base 16)
CHARACTER CONSTANT A character constant is one character enclosed in single quotes, as in ‘z’. The rule for writing character constant is given below:-       a character constant is C++must contain one character and must be enclosed in single quotation marks. C++ allows us to have certain non-graphic characters. These cannot be typed directly from keyboard. E.g., backspace, tabs, carriage, return etc.
ESCAPE SEQUENCE
FLOATING CONSTANTS Floating constants are also called real constants. Real constants are functions having fractional parts. These may be written in one of the two forms called fractional form or the exponent form. It consists of signed or unsigned digits including a decimal point between digits. The rule for writing a real constant is:- A real constant in fractional form must have at least one digit after the decimal point. It may also have either + or – sign preceding it. A real constant with no sign is assumed to be positive.
STRING LITERALS:- Multiple character constants are treated as string- literals. The rule for writing string-literal is given below:- A string literal is a sequence of characters surrounded by double quotes. Specifically, most string literals can be specified using:   declarative notation;  whitespace delimiters (indentation);  bracketed delimiters (quoting);  escape characters; or  a combination of some or all of the above
PUNCTUATORS A punctuator is a token that has syntactic and semantic meaning to the compiler, but the exact significance depends on the context. A punctuator can also be a token that is used in the syntax of the preprocessor.
OPERATORS Operators are tokens that trigger some computation when applied to variables and other objects in an expression. The following list gives a brief description of the operators and their functions. Unary operators require one operand to operate upon. Binary operators require two operands to operate upon.
ORDER OF PRECEDENCE ( )  [ ]   ! ~ + - ++ -- & *(typeset) * / % + -  << >> < <=  != & ^  I && II ?: =  *= / %=   += -=  &=  ^=  I=  <  <=  >  >=
THANK YOU

More Related Content

What's hot

Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C ProgrammingKamal Acharya
 
Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++Ankur Pandey
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++K Durga Prasad
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C ProgrammingQazi Shahzad Ali
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ LanguageWay2itech
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constantsvinay arora
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic Manzoor ALam
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
C data type format specifier
C data type format specifierC data type format specifier
C data type format specifierSandip Sitäulä
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c languageRai University
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++Ameer Khan
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_outputAnil Dutt
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction toolssunilchute1
 
Basic Structure Of C++
Basic Structure Of C++Basic Structure Of C++
Basic Structure Of C++DevangiParekh1
 

What's hot (20)

Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
 
Data type in c
Data type in cData type in c
Data type in c
 
Data Handling
Data HandlingData Handling
Data Handling
 
02a fundamental c++ types, arithmetic
02a   fundamental c++ types, arithmetic 02a   fundamental c++ types, arithmetic
02a fundamental c++ types, arithmetic
 
C tokens
C tokensC tokens
C tokens
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
C data type format specifier
C data type format specifierC data type format specifier
C data type format specifier
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
Csharp4 basics
Csharp4 basicsCsharp4 basics
Csharp4 basics
 
Basic Structure Of C++
Basic Structure Of C++Basic Structure Of C++
Basic Structure Of C++
 
C++ Version 2
C++  Version 2C++  Version 2
C++ Version 2
 

Viewers also liked

Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programsharman kaur
 
Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Ant Wong
 
Artificial Intelligence for Internet of Things Insights from Patents
Artificial Intelligence for Internet of Things Insights from PatentsArtificial Intelligence for Internet of Things Insights from Patents
Artificial Intelligence for Internet of Things Insights from PatentsAlex G. Lee, Ph.D. Esq. CLP
 
Ara Social Web 9 09 Small
Ara Social Web 9 09 SmallAra Social Web 9 09 Small
Ara Social Web 9 09 Smallmhines
 
IBM Internet of Things R&D Insights from Patents
IBM Internet of Things R&D Insights from PatentsIBM Internet of Things R&D Insights from Patents
IBM Internet of Things R&D Insights from PatentsAlex G. Lee, Ph.D. Esq. CLP
 
Biweekly Financial Commentary 08 01 28.A
Biweekly Financial Commentary 08 01 28.ABiweekly Financial Commentary 08 01 28.A
Biweekly Financial Commentary 08 01 28.AAnt Wong
 
Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Ant Wong
 
Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Ant Wong
 
Wireless Patents under the PTAB’s IPR & CBM Scrutiny
Wireless Patents under the PTAB’s IPR & CBM ScrutinyWireless Patents under the PTAB’s IPR & CBM Scrutiny
Wireless Patents under the PTAB’s IPR & CBM ScrutinyAlex G. Lee, Ph.D. Esq. CLP
 
Prosvjed Glazbom
Prosvjed GlazbomProsvjed Glazbom
Prosvjed Glazbomgrlica22
 
Cv D Os & Don Ts
Cv D Os & Don TsCv D Os & Don Ts
Cv D Os & Don Tsmmahwish
 
(Microsoft v. Google) Smartphone Patent Wars: Legal & Policy Issues of Standa...
(Microsoft v. Google) Smartphone Patent Wars: Legal & Policy Issues of Standa...(Microsoft v. Google) Smartphone Patent Wars: Legal & Policy Issues of Standa...
(Microsoft v. Google) Smartphone Patent Wars: Legal & Policy Issues of Standa...Alex G. Lee, Ph.D. Esq. CLP
 
Apache CloudStack: API to UI (STLLUG)
Apache CloudStack: API to UI (STLLUG)Apache CloudStack: API to UI (STLLUG)
Apache CloudStack: API to UI (STLLUG)Joe Brockmeier
 

Viewers also liked (20)

Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
 
Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programs
 
HMES Sandra Paterna
HMES Sandra PaternaHMES Sandra Paterna
HMES Sandra Paterna
 
Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14
 
Artificial Intelligence for Internet of Things Insights from Patents
Artificial Intelligence for Internet of Things Insights from PatentsArtificial Intelligence for Internet of Things Insights from Patents
Artificial Intelligence for Internet of Things Insights from Patents
 
Victor Molev
Victor MolevVictor Molev
Victor Molev
 
Ara Social Web 9 09 Small
Ara Social Web 9 09 SmallAra Social Web 9 09 Small
Ara Social Web 9 09 Small
 
AFS7 Math1
AFS7 Math1AFS7 Math1
AFS7 Math1
 
AFS7 Math 3
AFS7 Math 3AFS7 Math 3
AFS7 Math 3
 
IBM Internet of Things R&D Insights from Patents
IBM Internet of Things R&D Insights from PatentsIBM Internet of Things R&D Insights from Patents
IBM Internet of Things R&D Insights from Patents
 
Biweekly Financial Commentary 08 01 28.A
Biweekly Financial Commentary 08 01 28.ABiweekly Financial Commentary 08 01 28.A
Biweekly Financial Commentary 08 01 28.A
 
Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14
 
Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14Biweekly Financial Commentary 09 09 14
Biweekly Financial Commentary 09 09 14
 
Wireless Patents under the PTAB’s IPR & CBM Scrutiny
Wireless Patents under the PTAB’s IPR & CBM ScrutinyWireless Patents under the PTAB’s IPR & CBM Scrutiny
Wireless Patents under the PTAB’s IPR & CBM Scrutiny
 
Ib.2009
Ib.2009Ib.2009
Ib.2009
 
Prosvjed Glazbom
Prosvjed GlazbomProsvjed Glazbom
Prosvjed Glazbom
 
Cv D Os & Don Ts
Cv D Os & Don TsCv D Os & Don Ts
Cv D Os & Don Ts
 
microsoft
microsoftmicrosoft
microsoft
 
(Microsoft v. Google) Smartphone Patent Wars: Legal & Policy Issues of Standa...
(Microsoft v. Google) Smartphone Patent Wars: Legal & Policy Issues of Standa...(Microsoft v. Google) Smartphone Patent Wars: Legal & Policy Issues of Standa...
(Microsoft v. Google) Smartphone Patent Wars: Legal & Policy Issues of Standa...
 
Apache CloudStack: API to UI (STLLUG)
Apache CloudStack: API to UI (STLLUG)Apache CloudStack: API to UI (STLLUG)
Apache CloudStack: API to UI (STLLUG)
 

Similar to C++ (20)

C-PROGRAM
C-PROGRAMC-PROGRAM
C-PROGRAM
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
C PROGRAMMING LANGUAGE.pptx
 C PROGRAMMING LANGUAGE.pptx C PROGRAMMING LANGUAGE.pptx
C PROGRAMMING LANGUAGE.pptx
 
C programming.pdf
C programming.pdfC programming.pdf
C programming.pdf
 
Presentation of c2
Presentation of c2Presentation of c2
Presentation of c2
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
C presentation book
C presentation bookC presentation book
C presentation book
 
Introduction to C++ (for beginner): C++ Keywords.pptx
Introduction to C++  (for beginner): C++ Keywords.pptxIntroduction to C++  (for beginner): C++ Keywords.pptx
Introduction to C++ (for beginner): C++ Keywords.pptx
 
C programming notes
C programming notesC programming notes
C programming notes
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C++
C++C++
C++
 
Cnotes
CnotesCnotes
Cnotes
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
 
Basic of the C language
Basic of the C languageBasic of the C language
Basic of the C language
 
C notes
C notesC notes
C notes
 
cunit1.pptx
cunit1.pptxcunit1.pptx
cunit1.pptx
 
434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
 
C introduction
C introductionC introduction
C introduction
 
Lecture 01 2017
Lecture 01 2017Lecture 01 2017
Lecture 01 2017
 

Recently uploaded

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Recently uploaded (20)

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

C++

  • 1. C++ INTRODUCTION AND TOKENS Made by: RAFIYA SIRIN XI-B
  • 2. C++ INTRODUCTION C++ was developed by Bjarne Stroustrup of AT&T Bell Laboratories in the early 1980's, and is based on the C language. The name is a pun - "++" is a syntactic construct used in C and C++ is intended as an incremental improvement of C. Most of C is subset of C++, so that most C programs can be compiled (i.e. converted into a series of low-level instructions that the computer can execute directly) using a C++ compiler. The name C++ was coined by Rick Mascitti. Ever since it’s birth it has coped up with problems encountered by users, and through discussions at AT&T. however the maturation of the C++ language is attested to by two recent events: (i) the formation of American National Standard Institute) C++ committee (ii) the publication of The Annotated C++ Reference Manual by Ellis and Stroustrup.
  • 3. Because C++ retains C as a subset, it gains many of the attractive features of the C language, such as efficiency, closeness to the machine, and a variety of built-in types. A number of new features were added to C++ to make the language even more robust, many of which are not used by novice programmers. By introducing these new features here, we hope that you will begin to use them in your own programs early on and gain their benefits. Some of the features we will look at are the role of constants, inline expansion, references, declaration statements, user defined types, overloading, and the free store.
  • 4. THE SMALLEST INDIVIDUAL UNIT IN A PROGRAM IS KNOWN AS A TOKEN OR A LEXICAL UNIT TOKENS
  • 5. KEYWORDS IDENTIFIERS TOKENS LITERALS PUNCTUATORS OPERATORS
  • 6. KEYWORDS In computer programming, a keyword is a word or identifier that has a particular meaning to the programming language. The meaning of keywords — and, indeed, the meaning of the notion of keyword — differs widely from language to language.   In many languages, such as C and similar environments like C++, a keyword is a reserved word which identifies a syntactic form. Words used in control flow constructs, such as if, then, and else are keywords. In these languages, keywords can also be used as the names of variables or functions.
  • 8. IDENTIFIERS In computer science, Identifiers (IDs) are lexical tokens that name entities. The concept is analogous to that of a "name." Identifiers are used extensively in virtually all information processing systems. Naming entities makes it possible to refer to them, which is essential for any kind of symbolic processing. Computer languages usually place restrictions on what characters may appear in an identifier. For example, in early versions the C and C++ language, identifiers are restricted to being a sequence of one or more ASCII letters, digits (these may not appear as the first character), and underscores. Later versions of these languages, along with many other modern languages support almost all Unicode characters in an identifier (a common restriction is not to permit white space characters and language operators).
  • 9. RULES FOR DETERMING AN IDENTIFIER First character must be a letter After that any combination of letters and digits can be taken. Only underscore can be included and must be treated as a letter. Keywords cannot be used as identifiers.
  • 10. SOME VALID AND INVALID IDENTIFIERS VALID:- My file DATE9_7_77 Z2T0Z9 MYFILE _DS _HJI3_JK _CHK FILE13 INVALID:- DATA-REC contains special character 29CLCT starting with a digit break reserved keyword My.file contains special character
  • 11. LITERALS In computer science, a literal is a notation for representing a fixed value in source code. Almost all programming languages have notations for atomic values such as integers, floating-point numbers, strings, and Booleans; some also have notations for elements of enumerated types and compound values such as arrays, records, and objects. Literals are divided into four types: integer-constant character- constant Floating constant String-literal
  • 12. INTEGER CONSTANTS They are whole numbers without any fractional parts. the method of writing integer constants has been specified in following rule:- an integer constant must have at least one digit and must not contain any decimal point. It may contain either + or – sign. A number with no sign is assumed to be positive. Commas cannot appear in an integer constant. This again has three types: (i)decimal(base 10) (ii)octal(base 8) (iii)hexadecimal(base 16)
  • 13. CHARACTER CONSTANT A character constant is one character enclosed in single quotes, as in ‘z’. The rule for writing character constant is given below:- a character constant is C++must contain one character and must be enclosed in single quotation marks. C++ allows us to have certain non-graphic characters. These cannot be typed directly from keyboard. E.g., backspace, tabs, carriage, return etc.
  • 15. FLOATING CONSTANTS Floating constants are also called real constants. Real constants are functions having fractional parts. These may be written in one of the two forms called fractional form or the exponent form. It consists of signed or unsigned digits including a decimal point between digits. The rule for writing a real constant is:- A real constant in fractional form must have at least one digit after the decimal point. It may also have either + or – sign preceding it. A real constant with no sign is assumed to be positive.
  • 16. STRING LITERALS:- Multiple character constants are treated as string- literals. The rule for writing string-literal is given below:- A string literal is a sequence of characters surrounded by double quotes. Specifically, most string literals can be specified using:   declarative notation; whitespace delimiters (indentation); bracketed delimiters (quoting); escape characters; or a combination of some or all of the above
  • 17. PUNCTUATORS A punctuator is a token that has syntactic and semantic meaning to the compiler, but the exact significance depends on the context. A punctuator can also be a token that is used in the syntax of the preprocessor.
  • 18.
  • 19. OPERATORS Operators are tokens that trigger some computation when applied to variables and other objects in an expression. The following list gives a brief description of the operators and their functions. Unary operators require one operand to operate upon. Binary operators require two operands to operate upon.
  • 20.
  • 21. ORDER OF PRECEDENCE ( ) [ ] ! ~ + - ++ -- & *(typeset) * / % + - << >> < <= != & ^ I && II ?: = *= / %= += -= &= ^= I= < <= > >=