Basics of 'C' (Tokens)


Tokens


Keyword
This word is having some Special Meaning. (i.e.) for this word already some program build by the author.
Ex        for, while, if, int…

Data-type
Which type of data we are giving that is data type. There are two types.
1.                  Numeric Data type.
i.                    integer
ii.                  floating point
2.                  Character Data Type.
i.                    Character
ii.                  String

Table for Data type details

Target
Data-Type
C/S
Bytes
Range
Whole number
Int
%d
2 Bytes
-32768to 32767
Floating Point
Float
%f
4 Bytes
3.4E-38to3.4E+38
Character
Char
%c
1 Byte
-128 to 127 and 0 to 255
String
Char-Array
%s
User-Define
User-Defined

Variables or Identifiers:
Variables means  Named Memory Location.
Rules for Naming Variables:
i.                    Variable name should be started with Alphabet or Underscore
ii.                  Variable name should contain with in 32 characters.
iii.                Variable name should not be in keyword.
iv.                Variable name should have the following range...
                        A - Z, a - z, 0 -9, _
Declaring Variables:
[ Storage-Class] <Data-type> Variable1,Variable2,...;
Ex:
int a, b, c;                    a=12                à        Integer Variable
Char ch, dh;    ch='i'                à        Character Variable
float jk, kl;       jk=12.34          à        Floating Point  Variable

Constants
The Contants means nothing but, During Program Execution the Variables Value won't change.By using <const> Key word we can able to mention the variables as a constant variables. If you need to modify the value of the constant variable during program execution time by using pointer we can able to perform that operation.

Syntax
<const> variable = <Value>;
                                    or
<const> <Data-Type> Variable-Name = <Value>;
Ex
const a = 12;
const float b = 12.45;
The Constants is classified into Two types.
i.                    Numeric Constants.
ii.                  Character Constants.

No comments: