Saturday, 15 August 2015

Pointers in C Programming Language

Pointer in C Programming Language
A Pointer is a programming Language Object, Whose Value refers to another value stored else where in the computer memory using it's address. 

First Known As two Various in Pointers .  

1. &  Address of Operator.
2. *  Value Of Operator.

Simple To Understand :

1. if have a two variables a,b.
2.a ,b having few numbers for storage address.
3. if a storage address are having some values ( content ).
4.b having storage address first second point , the address numbers are a storage address values.
Program
#include<stdio.h> 
#include<conio.h>
int main()
{

int x=10;
int *j;
j=&x;

printf(" The Value of x is %d\n",x);
printf(" The Address of X is %p\n",&x);
printf("The value of x is *(&x)%d\n\n",*(&x));


printf(" The memory address storage pointer j is %P\n",j);
printf(" The value of pointer by the pointer  of j is %d\n",*j);
printf("The address of pointer j is %p",&j);

getch();
return 0;

}

Output
The Value of x is 10
The Address of X is 000000000023FE4C
The value of x is *(&x) 10

The memory address storage pointer j is 000000000023FE4C
The value of pointer by the pointer  of j is 10
The address of pointer j is 000000000023FE40





No comments:

Post a Comment