Tokens in C++

MahenderBoda 8,442 views 16 slides Mar 18, 2017
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

This is the presentation on tokens done by me and my friends as a team.


Slide Content

Presented by Divya Sree Rayshini Issac Mahender TOKENS

Tokens are the basic building blocks in C++ language. The smallest individual units in a program are known as tokens. A program is constructed using a combination of these tokens. TOKENS

K eywords V ariables C onstants S trings O perators FIVE TYPE OF TOKENS

K eywords V ariables C onstants S trings O perators FIVE TYPE OF TOKENS

Definition: Sequence of characters that have a fixed meaning . Keywords must be written in lower case. Reserved identifiers and can’t be used as names for the program variables user-defined program elements. KEY WORDS Examples: int , float, char, double, switch, break, char, const , Continue, default, for, if, goto , static, void, sizeof , while, return, int , long, do, while etc…

K eywords V ariables C onstants S trings O perators FIVE TYPE OF TOKENS

Definition: A variable is a quantity whose value may change during the program execution. Examples: int a, char choice, etc ., VARIABLES

Naming Conventions: A variable name should contain alphabets (a-z , A-Z) and digits (0-9). not start with a number or a digit. not be a keyword. case sensitive.

Naming Conventions: A variable name should contain alphabets (a-z , A-Z) and digits (0-9). not start with a number or a digit. not be a keyword. case sensitive.

K eywords V ariables C onstants S trings O perators FIVE TYPE OF TOKENS

CONSTANTS Definition : The quantities whose value do not change during the program execution are known as constants.

K eywords V ariables C onstants S trings O perators FIVE TYPE OF TOKENS

Definition: A group of characters that are treated as a single data item enclosed in double quotes are known as strings. General syntax: char string-name[size]; size determines the number of characters in the string name. Example: char city[9]=“New York”; STRINGS

K eywords V ariables C onstants S trings O perators FIVE TYPE OF TOKENS

Definition: An operator is a symbol that performs operations on one or more operants. There are 8 types of operators supported by C ++ language . OPERATORS

Arithmetic operators (+,-,*,/,%) Relational operators (==,!=,<,>,<=,>=) Logical operators (||,&&,!) Conditional operators (? :) Assignment operators (=,+=,-=,/=,*=,%=,) Increment /decrement operators (++,--) Bitwise operators (&,|,^,<<,>>,~) Miscellaneous/special operators (sizeof,*,->) EIGHT TYPES OF OPERATORS
Tags