Sunday, 13 January 2013

Program showing Dynamic memory management technique in C



#include
#include
void main()
{
int *array,n,i;
clrscr();
printf("\nEnter the size of array\n");
scanf("%d",&n);
array=(int *)malloc(n*sizeof(int));
printf("\nEnter the %d element\n",n);
for(i=0;i scanf("%d",array+i);
printf("\nYour elements are:\n");
for(i=0;i printf("%d\t",*(array+i));
getch();
}


Output



Enter your email address:

Delivered by FeedBurner