C++
IDENTIFIERS IN C++
Constant
§ Any information is constant.
§ Data = information = constant.
Type of constant
In starting we focus on primary Constant
§ Integer Constant
Integer constants are those constant which no point values.
For example; 23, -341, 0, 5
§ Real Constants
Real constants are those constant which have point values.
For example; , 3.4, -0.06, 3.0
§ Character Constants
Character constants are those constant which cover their values by single quote (‘).
For example; ‘a’, ‘A’, ‘+’, ‘2’, ‘ ’
Remember that:
Character constant having only and only following conditions;
§ Cover by single quotes (‘).
§ Having length 1 character only.
For example
-3 is not a character constant
Because -3 have two character – and 3.
Mobile number à integer constant
Mobile balance à Real Constant
your city name à string (not a character const.)
Mobile balance à Real Constant
your city name à string (not a character const.)
New Delhi à Secondary constant (string)
§ String Constants
String constants is the combination of character constant and shown by double quote (“).
For example; “Abhishek sharma”, “Delhi”.
Secondary Constant
§ Secondary constants are dependent on primary constant.
For example
“Abhishek Sharma” Ã combination of character const.
Memory Configuration
Variables
§ Variables are the name of the memory location where data will store.
§ Variable name is any combination of Alphabet (a to z or A to Z), digits (0 to 9) and Underscore (_).
§ Valid variable name can’t start with digits.
Keywords
§ Predefined word or Reserved words
§ Compiler already know the meaning of these words.
§ There are 48 keywords in C++
**You reached end of lecture**

Post a Comment
0 Comments