Answer Posted / vara
There are two differences.
1) is the number of arguments. Malloc() takes a single
argument (memory required in bytes), while calloc() needs
two arguments (number of variables to allocate memory, size
in bytes of a single variable).
2)malloc() does not initialize the memory allocated, while
calloc() initializes the allocated memory to ZERO.
Is This Answer Correct ? | 15 Yes | 2 No |
Post New Answer View All Answers
Explain what is the difference between null and nul?
What is nested structure in c?
main() { printf("hello"); fork(); }
Explain how can I write functions that take a variable number of arguments?
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Can a pointer be static?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values. The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.
Is it possible to have a function as a parameter in another function?
How do you generate random numbers in C?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
Can you subtract pointers from each other? Why would you?
What is a stream?
What is meant by errors and debugging?