IDENTIFIERS IN C++ TRB CSI › Programming with C++ › identifiers

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…

Premium — locked Advanced 13 min 54 cards 6 programs 9 MCQs v2
This is a premium lesson. You can see the shape of every card — unlock to read them. Unlock

IDENTIFIERS IN C++…

Premium This card is part of the premium lesson. Unlock
Definition

Identifier என்பது C++ program-ல் programmer உருவாக்கும் name. Variables, functions, classes, objects, arrays……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int age = 25; இதில்: age என்பது Identi……

Premium This card is part of the premium lesson. Unlock
Simple Explanation

Real life-ல் ஒரு classroom-ல் 50 students இருக்கிறார்கள் என்று வைத்துக்கொள்ளுங்கள். ஒவ்வொருவரையும் ide……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int marks = 90; float salary = 25000.50; ……

Premium This card is part of the premium lesson. Unlock
Explanation
Why identifier is needed

Suppose: int x = 90; x என்பது v……

Premium This card is part of the premium lesson. Unlock
Real Life Example
Identifier examples

int age; int totalMarks; float salary; char grade; Identifiers: age totalMarks salary grade IDENTIFIERS……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int total; total → Variable ident……

Premium This card is part of the premium lesson. Unlock
Explanation

Student → Class identifier Student s1; ……

Premium This card is part of the premium lesson. Unlock
Explanation
Identifier rules

C++-ல் identifier உருவாக்கும்போது சில important rules follow செய்ய வேண்டும். RULE 1: IDENTIFIER MUST BEGIN WI……

Premium This card is part of the premium lesson. Unlock
Memory Trick

Number end-ல் வரலாம்; start-ல் வரக்கூடாது. RULE 3: DIGITS CAN BE USED AFTER THE FIRST CHARACTER Valid: int ma……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int for = 10; Compiler-க்கு for என்றால் ஏற்கனவே looping statement என்று meaning உள்ளது. Programmer அதை variab……

Premium This card is part of the premium lesson. Unlock

Because age ≠ Age ≠ AGE. RULE 8: UNDERSCORE CAN BE USED Examples: int student_mark; int total_marks; int _cou……

Premium This card is part of the premium lesson. Unlock
Explanation

return 0; }…

Premium This card is part of the premium lesson. Unlock
Explanation

int age = 25; int → Keyword / Data type age → Identifier = → Assignment operator 25 → Integer literal ; → Pun……

Premium This card is part of the premium lesson. Unlock
Explanation
How compiler sees identifier

Consider: int marks = 90; Lexical analysis stage-ல் compiler roughly: int → Keyword marks → Identifier = → Op……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int total; int → Keyword total → Identifie……

Premium This card is part of the premium lesson. Unlock
Comparison
Difference

age → Name 25 → Value IDENTIFIER vs CONSTANT Consider……

Premium This card is part of the premium lesson. Unlock
Important

Even though MAX represents a constant variable, the word MAX itself is still an ident……

Premium This card is part of the premium lesson. Unlock
Dry Run

Consider: int studentMark = 85; Step 1: Compiler sees: int Keyword. Step 2:……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 1

Starting with number Wrong: i……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 2

Using spaces Wrong: int total……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 3

Keyword as identifier Wrong: ……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 4

Special character Wrong: int ……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 5

Case confusion int marks = 10……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error.

Because: marks ≠ Marks…

Premium This card is part of the premium lesson. Unlock
Important

Remember these five rules str……

Premium This card is part of the premium lesson. Unlock
Important

1. Letter or underscore-ல் start ஆக வேண்டும். 2. Number-ல் start ஆ……

Premium This card is part of the premium lesson. Unlock
Remember

L D U - No S K L → Letters allowed D → Digits allowed after first character U → U……

Premium This card is part of the premium lesson. Unlock
TRB Point

Definition Question What is an identifier? An identifier is a prog……

Premium This card is part of the premium lesson. Unlock
MCQ

Which is a valid C++ identifi……

Premium This card is part of the premium lesson. Unlock
Interview Point

Are value, Value, and VALUE the same identifiers? No. ……

Premium This card is part of the premium lesson. Unlock
MCQ

Which of the following is a v……

Premium This card is part of the premium lesson. Unlock
MCQ

An identifier can begin with:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which cannot be used as an id……

Premium This card is part of the premium lesson. Unlock
MCQ

Which one is invalid?…

Premium This card is part of the premium lesson. Unlock
MCQ

C++ identifiers are:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which pair represents differe……

Premium This card is part of the premium lesson. Unlock
MCQ

Which character is normally a……

Premium This card is part of the premium lesson. Unlock
MCQ

In the statement: int salary ……

Premium This card is part of the premium lesson. Unlock
Practice

Find valid and invalid identifiers: student 1student student1 student_name student-name while _Total total ma……

Premium This card is part of the premium lesson. Unlock
Summary

Identifier = programmer-defin……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int marks = 90; Here: marks → Identifier Identifiers can represent: Variable name Function name Class na……

Premium This card is part of the premium lesson. Unlock
Text size
17px
Theme
Contents
Print / PDF
Program