What is difference between new and malloc?

Answer Posted / devi

In C the malloc is used to allocate the memory space


In C++ the new operator is used to allocate the memory space

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Get me an image implementation program.

1557


Why do while loop is used?

573


What is the oops and benefits of oops programming?

551


Is react oop?

608


Why do we use oops?

593






write a program to find 2^n+1 ?

1549


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1652


Advantage and disadvantage of routing in telecom sector

786


What is a class in oop?

601


Write a program to reverse a string using recursive function?

1792


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2164


What is the real time example of encapsulation?

595


What is balance factor?

586


How to call a non virtual function in the derived class by using base class pointer

5255


What is new keyword in oops?

590