Raghav Solutions
Raghav Solutions provides Training in Various programming languages like C,C++,Visual studio.Net, PHP for B.E.,B.C.A. M.C.A. and other technical students.
//Realloc Example
int main()
{
int *ptr, i , n1, n2;
printf("Enter size: ");
scanf("%d", &n1);
ptr = (int*) malloc(n1 * sizeof(int));
printf("Addresses of previously allocated memory: ");
for(i = 0; i < n1; ++i)
printf("%u\n",ptr + i);
printf("\nEnter the new size: ");
scanf("%d", &n2);
// rellocating the memory
ptr = realloc(ptr, n2 * sizeof(int));
printf("Addresses of newly allocated memory: ");
for(i = 0; i < n2; ++i)
printf("%u\n", ptr + i);
free(ptr);
return 0;
}
24/04/2020
Dynamic Memory Allocation Functions(Continued...)
Click here to claim your Sponsored Listing.
Category
Telephone
Website
Address
Khargone
451001
Opening Hours
| Monday | 5pm - 9pm |
| Tuesday | 5pm - 9pm |
| Wednesday | 5pm - 9pm |
| Thursday | 5pm - 9pm |
| Friday | 5pm - 9pm |
| Saturday | 5pm - 9pm |