1.

You Have Two Pairs: New() And Delete() And Another Pair : Alloc() And Free(). Explain Differences Between Eg. New() And Malloc()

Answer»
  1. "new and DELETE" are PREPROCESSORS while "malloc() and free()" are functions, [we dont use brackets will calling new or delete].
  2. no need of allocate the memory while using "new" but in "malloc()" we have to use "sizeof()".
  3. "new" will initlize the new memory to 0 but "malloc()" GIVES random value in the new alloted memory LOCATION [BETTER to use calloc()]



Discussion

No Comment Found