#include<stdio.h> |
#include<stdlib.h> |
void
main() |
{ |
int i,s; |
int *p; |
printf("\nEnter The Size of Array :"); |
scanf("%d",&s); |
p=(int *)malloc(s*sizeof(int)); |
for(i=0;i<s;i++) //p++ to Increment
pointer |
{ |
printf("Enter Number %d
:",i+1); |
scanf("%d",&p[i]); |
} |
printf("\nIndex \tValue \tAddress"); |
for(i=0;i<10;i++,p++)
//p++ to Increment pointer |
{ |
printf("\n%d \t%d \t%u
",i+1,*p,p); |
} |
free(p); //To Release the allocated memory |
} |
|