C Language Interview Question and Answers
56. | What is the difference between malloc and calloc? |
---|---|
malloc is use for memory allocation and initialize garbage values.malloc () for allocating the single block of memory. where as calloc is same as malloc but it initialize 0 value.calloc () for allocating multiple blocks of memory. |
|
57. | What is null pointer? |
---|---|
NULL pointer is a pointer which is pointing to nothing. Examples : int *ptr=(char *)0; float *ptr=(float *)0; |
|
58. | How are pointer variables initialized? |
---|---|
|
|
59. | What is copy constructor? |
---|---|
Copy constructor is a constructor function with the same name as the class and used to make deep copy of objects. | |
60. | What is the difference between #include‹ › and #include “ ”? |
---|---|
#include‹ › ----> Specifically used for built in header files. #include “ ” ----> Specifically used for used for user defined/created n header file. |
|