#include<stdio.h>
#include<conio.h>
main()
{
int *a,i,n,y;
clrscr();
printf("How many Blocks U want to Create For Array =");
scanf("%d",&n);
for(i=0;i<n;i++)
{
{
}
for(i=0;i<n;i++)
{
printf("a[%d]==> ",i);
scanf("%d",&a[i]);
}
printf("\n============Array Is=============\n");
for(i=0;i<n;i++)
{
printf("\n a[%d]==>%d ",i,a[i]);
}
printf("\n How Many Memory U want to Reallocate =");
scanf("%d",&y);
for(i=0;i<y;i++)
{
for(i=0;i<y;i++)
{
}
for(i=n;i<n+y;i++)
{
printf("a[%d]==> ",i);
scanf("%d",&a[i]);
}
printf("\n======== again Array Is=============\n");
for(i=0;i<n+y;i++)
{
printf("\n a[%d]==>%d ",i,a[i]);
}
getch();
}
-------------------------------------------------------------------------------
The Realloc() function changes the size of a block of memory that was previously allocated with Malloc() or Calloc().
-------------------------------------------------------------------------------
What is Realloc ?
The Realloc() function changes the size of a block of memory that was previously allocated with Malloc() or Calloc().
No comments:
Post a Comment