Thursday 30 July 2015

C LANGUAGE


I n C we have 3 words
    There are 
                 1.Constant 
                  2. Variables
                   3.key words or reserved words
...................................................................................................................................................................

CONSTANTS:
                      
                      Constants means fixed values. i.e their value is not change in our program. Not only integer values but also char data type,float data type, strings also.
for examples in strings are enclosed in double quotes.
    for   char type is enclosed in single quotes. 
...................................................................................................................................................................VARIABLES:
                     
                 Variables are represented in english words are user defined words except key word.this variables are store varying values or changing values. 
    SYN: datatype variable1,variable2.............;
datatypes are int, char, float, double ect,
we can use in place of datatype.
...................................................................................................................................................................KEYWORDS:
  
                    In C we have some words which we can not use variables. they have some special meaning only. these are called reserved words or key words.
In C we have 32 key words.
there are

auto    break  case   char    const    continue   default  do    double   else  enum   extern    float   for   goto    if   int    long    register   return    sizeof   short     signed    static   stuct   switch    typedef           union      unsigned      void    volatile    while.



*********************************************************************************

 DYNAMIC MEMORY ALLOCATION:
                       
                                                                In our PC's or general purpose computers are having large memory,but in that memory only some of memory used while executing  a programs. An Operating system is stored in main memory but in lower part of the memory.On the top of this memory we have four memory segments.

1.code segment
2.data segment
3.heap segment
4.stack segment



******************************************************************************


STRUCTURES


                             We know that an array  represents a group of elements which are similar datatype, arrays are useful to store and retrieve groups of elements. But there is an inconvenience while using arrays, i.e all the elements should belongs to same datatype.But we can not store mixed datatypes like an integer number, a float number and a string into a same array.
                   
                            So  we have comes structures topic, it is useful in daily life applications. we can declare structure by following syntax.


                             SYN:-   struct details
                                        {

                                            int marks;
                                            char name[20];
                                           float per;

                                          };
                                                           
                structure can declared "struct" key word, then we should  write structure name i.e details
with in the braces we should declare elements.
 after completion declare we should write object then only memory  is allocated to structure.


                         SYN: struct details  de;






No comments:

Post a Comment