What is C Language
What is C Language
• Alphabets a to z, A to Z
• Numeric 0,1 to 9
• Special Symbols {,},[,],?,+,-,*,/,%,!,;,and more
Tokens of ‘C’
Types of C Constants
Ex.: 426
+782
-8000
-7605
Rules for Constructing Real Constants
Real constants are often called Floating Point constants. The real
constants could be written in two forms—Fractional form and
Exponential form.
Following rules must be observed while constructing real
constants expressed in fractional form:
(a) A real constant must have at least one digit.
(b) It must have a decimal point.
(c) It could be either positive or negative.
(d) Default sign is positive.
(e) No commas or blanks are allowed within a real constant.
Rules for Constructing Real Constants
Cont--
Hungarian Notation For Declaring Variable Names
2) Type Indicator: The prefix often denotes the data type of the
variable. For example:
i for integer (int)
f for float (float)
c for character (char)
b for boolean (bool)
ptr for pointer (*)
Cont--
Hungarian Notation For Declaring Variable Names
3) Purpose Indicator: Sometimes, the prefix indicates the purpose
or usage of the variable:
– n for a count or number
– sz for a zero-terminated string (char*)
– p for a pointer
Examples of Hungarian Notation:
• int iCount; (where i indicates integer)
• float fTemperature; (where f indicates float)
• char *pszName; (where psz indicates a pointer to a zero-terminated string)
• BOOL bIsReady; (where b indicates a boolean)