TOKENS IN C++…
TOKENS IN C++
Token என்பது C++ program-ல் compiler புரிந்து கொள்ளும் smallest meaningful unit. Simple Tamil: C++ program-ஐ compiler ஒரே பெரிய sentence மாதிரி பார்க்காது. அதை சிறிய சிறிய meaningful parts-ஆக பிரித்து புரிந்து கொள்கிறது. அந்த smallest part…
Token என்பது C++ program-ல் compiler புரிந்து கொள்ளும் smallest meaningful unit. Simple Tamil: C++ p……
int total = 10 + 20; இதில் உள்ள to……
English sentence: I am a student இதில் words தனித்தனி meaning கொண்டவை. அதேபோல் C++: int age = 25; இதில்: int ……
KEYWORDS
Compiler-க்கு ஏற்கனவே predefi……
int float double char if else for while return class public private int age = 20; இங்……
Keyword-ஐ variable name ஆக பயன்படுத்த முடியாது. Wrong:……
IDENTIFIERS
Programmer உருவாக்கும் பெயர்கள் Identifiers. Variabl……
int marks = 90; இதில்: marks ஒரு identifier. Examples int age; float salary; char grade; Identifiers: age sal……
CONSTANTS / LITERALS
Program-ல் directly எழுதப்படு……
int age = 25; இங்கு: 25 literal. TYPES OF LITERALS Integer Literal Whole numbers. 1……
25.50 → Floating-point literal.
Character Literal Single charac……
char grade = 'A'; 'A' → character literal. String L……
"Hello" → String literal. Boolean Litera……
STRINGS
Characters-ன் sequence double……
"Hello World" Character vs Strin……
char grade = 'A'; string name……
OPERATORS
Values அல்லது variables மீது oper……
a + b இதில்: + operator. COMM……
- Addition - Subtraction - Mu……
/ Division % Modulus int resu……
10 value-ஐ x-க்கு assign செய்.…
= Assignment == Comparison இர……
age >= 18 Logical Operators && AND || OR ! NOT age……
PUNCTUATORS / SPECIAL SYMBOLS
C++ program structure உருவாக்க பயன்படும் special symbols Punctuators. Examples: ; , () {} [] : . SEMICOLON ; ……
அல்லது: main() CURLY BRACES {……
Mostly arrays-ல் பயன்படுத்தப்படும். int marks[5]; COMMA , Multipl……
Total: 5 tokens ANOTHER EXAMPLE float pri……
return 0; } Important tokens ……
Compiler-ன் ஆரம்ப stages-ல் source program tokens-ஆக பிரிக்கப்படுகிறது. i……
- → operator…
b → identifier ; → punctuator இந்த token identification process compiler-ன் Lexical Analysis stage-இன் முக்கி……
WHITE SPACE AND TOKENS int age=20; மற்றும்: int age = 20; இரண்டும் compiler-க்கு பொதுவாக same meani……
int 2marks; Wrong because ident……
int for; Wrong because for ke……
char grade = "A"; "A" string ……
int a = 10 Semicolon missing.……
Token is the smallest meaningful unit of a program. Keywords have predefined meaning. Identifiers are user-de……
x == 10…
'A' vs "A" 'A' Character literal. "A" String li……
K I C S O P K → Keyword I → Identif……
Question: What is a token in C++? Answer: A token is ……
For: int x = 25; Ask: "How many main……
The smallest meaningful unit ……
Which is a keyword?…
Which is a valid identifier?…
In the statement int x = 10;,……
Which one is a character lite……
In a + b, + is:…
Which symbol normally termina……
Identify every token: double salary = 25000.50; Answer: doub……
C++ Token = compiler recognize செய்யும் smallest meaningful program element. M……
int marks = 90; இதில்: int → Keyword marks → Identifi……