Wednesday, June 5, 2013

Pointer

A pointer is derived data type in C. It is built one of the fundamental data types available in C. Pointer contains memory addresses as their values. Since these memory addresses are the computer memory where program instructions and data are stored, pointers can be used to access and manipulate data stored in the memory.



eg:-

//program

#include<stdio.h>
#include<conio.h>\
void main()
{
char a;
int x;
float p, q;
printf("%c is stored at addr %u.\n",a,&a);
printf("%d is stored at addr%u.\n",x,&x);
printf("%f is stored at addr%u.\n",p,&p);
printf("%f is stored at addr%u.\n",q,&q);
getch();
}

Thursday, May 23, 2013

What is structure??

A structure is an object that consist of named members, that may be of different data types. The members have public access


Concept:  A structure provides a means of grouping variables under a single name for ease of use and handling of the same. The structure can be nested to develop complex hierarchies. Structure may be copied to and assigned value like other variables. They are also  useful in passing groups of logically related data into function.


Syntax:-

struct stucture_name
{
        ......
        .......     // list of data types and variable  name
       .......
};