Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
How does free know the size of memory to be deleted.?
int *i = (int *)malloc(12); followed by free(i); how did free function call know how much of memory to delete?
A: It based on the implementation, however usually there is a malloc header added to all the memory allocated through malloc. On Linux its four bytes of memory preceding the memory returned to you, which contain the number of bytes allocated + 4(itself). Thus while you say,
int *i = (int *)malloc(12);
it allocates 16 bytes.
-------------------
17 | | | |
^
|
i
Since you can see above total of 16 bytes are allocated, first four bytes stores the number of bytes allocated(offset to the next memory from the begin of this memory). Address of the 5th byte is returned to i. now i can access 12 bytes through this byte.
i want programs on grounded header linked list
farnahight of celsus
dsgdgdgdfgegwfesfsddfvxvwe
Write a Haskell program that calculates a balanced partition of N items where each item has a value between 0 and K such that the difference between the sum of the values of first
C Program for SORTING OF LONG WORD WITH DIFFERENT STRING #include stdio.h> #include conio.h> #include string.h> void main() { char n[50],c[25][25]
please answer the question of following Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? B
smugglers transfer the messages from one to another by using the mobile
write a program in c/C++ using nested if statement for calculating the average marks and grades of 5 subjects
write a program to find the area under the curve y=f(x) between x=a & x=b
program
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd