My Profile

I, Das ShrikKrishna J. MCA III IMSCD&R, Ahmednagar.

Monday, 15 August 2011

Implement "free" function

Write a Program in C to Implement "free" function
 
#include<stdio.h>
#include<conio.h>
void main()
{
int le,i,*pa;
clrscr();
printf("Enter Total Numbers\n");
scanf("%d",&le);
pa=(int*)malloc(le*sizeof(int));
printf("\nEnter %d numbers\n",le);
for(i=0;i<=le-1;i++)
{
scanf("%d",(pa+i));
}
printf("\nPrinting Numbers\n");
for(i=0;i<=le-1;i++)
{
printf("%d\n",*(pa+i));
}
free(pa);
getch();
}

No comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | cheap international calls