IDENTIFIERS IN C++…
IDENTIFIERS IN C++
Identifier என்பது C++ program-ல் programmer உருவாக்கும் name. Variables, functions, classes, objects, arrays போன்ற program elements-ஐ identify செய்ய நாம் கொடுக்கும் பெயர் தான் Identifier. Simple definition: A name used to identify a progra…
Identifier என்பது C++ program-ல் programmer உருவாக்கும் name. Variables, functions, classes, objects, arrays……
int age = 25; இதில்: age என்பது Identi……
Real life-ல் ஒரு classroom-ல் 50 students இருக்கிறார்கள் என்று வைத்துக்கொள்ளுங்கள். ஒவ்வொருவரையும் ide……
int marks = 90; float salary = 25000.50; ……
Suppose: int x = 90; x என்பது v……
int age; int totalMarks; float salary; char grade; Identifiers: age totalMarks salary grade IDENTIFIERS……
int total; total → Variable ident……
Student → Class identifier Student s1; ……
C++-ல் identifier உருவாக்கும்போது சில important rules follow செய்ய வேண்டும். RULE 1: IDENTIFIER MUST BEGIN WI……
Number end-ல் வரலாம்; start-ல் வரக்கூடாது. RULE 3: DIGITS CAN BE USED AFTER THE FIRST CHARACTER Valid: int ma……
int for = 10; Compiler-க்கு for என்றால் ஏற்கனவே looping statement என்று meaning உள்ளது. Programmer அதை variab……
Because age ≠ Age ≠ AGE. RULE 8: UNDERSCORE CAN BE USED Examples: int student_mark; int total_marks; int _cou……
return 0; }…
int age = 25; int → Keyword / Data type age → Identifier = → Assignment operator 25 → Integer literal ; → Pun……
Consider: int marks = 90; Lexical analysis stage-ல் compiler roughly: int → Keyword marks → Identifier = → Op……
int total; int → Keyword total → Identifie……
age → Name 25 → Value IDENTIFIER vs CONSTANT Consider……
Even though MAX represents a constant variable, the word MAX itself is still an ident……
Consider: int studentMark = 85; Step 1: Compiler sees: int Keyword. Step 2:……
Starting with number Wrong: i……
Using spaces Wrong: int total……
Keyword as identifier Wrong: ……
Special character Wrong: int ……
Case confusion int marks = 10……
Because: marks ≠ Marks…
Remember these five rules str……
1. Letter or underscore-ல் start ஆக வேண்டும். 2. Number-ல் start ஆ……
L D U - No S K L → Letters allowed D → Digits allowed after first character U → U……
Definition Question What is an identifier? An identifier is a prog……
Which is a valid C++ identifi……
Are value, Value, and VALUE the same identifiers? No. ……
Which of the following is a v……
An identifier can begin with:…
Which cannot be used as an id……
Which one is invalid?…
C++ identifiers are:…
Which pair represents differe……
Which character is normally a……
In the statement: int salary ……
Find valid and invalid identifiers: student 1student student1 student_name student-name while _Total total ma……
Identifier = programmer-defin……
int marks = 90; Here: marks → Identifier Identifiers can represent: Variable name Function name Class na……