What is Character set
A Character denotes any alphabets, digits and special symbols used to represent information
for Example
alphabets | A,B...Y,Z Or a,b...y,z |
Digits | 0,1,2,3,4,5,6,7,8,9 |
Special symbols | `~ !@#$%^&*()_+-=}{|":<>?/.,;'\][ |
Constants, variables and keywords
What different types of constants and variables in C
Types of constants in C
constants in C can be divided into two major categories:
- ) Primary constants
- ) Secondary constants
Primary constants
Secondary constants
Integer constantsReal constantsCharacter constants
ArrayPointerStructure Union Enum etc.
Rules for constructing integer constants
Integer constants
Real constants
Character constants
Array
Pointer
Structure
Union
Enum etc.
a). An integer constants must have at least one digits.
b). It must not have a decimal point.
c). It can be any of zero, positive or negative.
d). If no sign precedes an integer constants, it is assumed to be positive .
e). no commas or blanks are allowed within an integer constant.
f). The allowable range for integer constants is -2147483648 to +2147483648.
Truly speaking, the range of an integer constant depends upon the compiler. for compilers such as
Visual Studio, GCC, it is -2147483648 to +2147483647, Whereas for compilers such as turbo c or turbo
c++, the range is -32768 to +32767.
Rules for Constructing Real Constants
Real constants are often called foating point constants. 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.
for example:-
+345.4590.09-67.78-767.89685
Comments