WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?
Answer Posted / prakashdasari
malloc () for allocating the single block of memory
calloc () for allocating multiple blocks of memory
the values assigned are garbage in case of malloc() and
proper values (zeros) are assigned in case of calloc().
Is This Answer Correct ? | 114 Yes | 34 No |
Post New Answer View All Answers
What does void main return?
Differentiate between declaring a variable and defining a variable?
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
State the difference between realloc and free.
What is 2c dna?
What are different types of pointers?
How can I write a function that takes a format string and a variable number of arguments?
If you know then define #pragma?
find the sum of two matrices and WAP for it.
When should volatile modifier be used?
Is this program statement valid? INT = 10.50;
How pointers are declared?
You have given 2 array. You need to find whether they will
create the same BST or not.
For example:
Array1:10 5 20 15 30
Array2:10 20 15 30 5
Result: True
Array1:10 5 20 15 30
Array2:10 15 20 30 5
Result: False
One Approach is Pretty Clear by creating BST O(nlogn) then
checking two tree for identical O(N) overall O(nlogn) ..we
need there exist O(N) Time & O(1) Space also without extra
space .Algorithm ??
DevoCoder
guest
Posted 3 months ago #
#define true 1
#define false 0
int check(int a1[],int a2[],int n1,int n2)
{
int i;
//n1 size of array a1[] and n2 size of a2[]
if(n1!=n2) return false;
//n1 and n2 must be same
for(i=0;i
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()