Sunday 15 January 2012

Getting Started with C


The C Character Set 
A character denotes any alphabet, digit or special symbol used to
represent information. The valid alphabets,numbers and special symbols allowed in C are listed below:-
Alphabets                             A, B, ….., Y, Z
                                            a, b, ……, y, z
 Digits                                  0, 1, 2, 3, 4, 5, 6, 7, 8, 9
 Special symbols                  ~ ‘ ! @ #  % ^ & * ( ) _ - + = | \ { }  [ ] : ;  " ' < > , . ? /
Constants, Variables and Keywords 
The alphabets, numbers and special symbols when properly
combined form constants, variables and keywords. Let us see what
are ‘constants’ and ‘variables’ in C. A constant is an entity that
doesn’t change whereas a variable is an entity that may change. 
In any program we typically do lots of calculations. The results of
these calculations are stored in computers memory. Like human
memory the computer memory also consists of millions of cells.
The calculated values are stored in these memory cells. To make
the retrieval and usage of these values easy these memory cells
(also called memory locations) are given names. Since the value
stored in each location may change the names given to these
locations are called variable names. Consider the following
example.  
Here 3 is stored in a memory location and a name x is given to it.
Then we are assigning a new value 5 to the same memory location
x. This would overwrite the earlier value 3, since a memory
location can hold only one value at a time.

No comments:

Post a Comment