What is difference between new and malloc?

Answer Posted / vivin

new is a operator used for memory allocation in c++ & java

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the problem with multiple inheritance?

588


What is the benefit of oop?

573


What is polymorphism and types?

607


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

5283


Are polymorphisms mutations?

706






What are the three parts of a simple empty class?

1462


What is difference between class and object with example?

566


What is encapsulation selenium?

556


Why do we use oops?

597


How can you overcome the diamond problem in inheritance?

772


What is the fundamental idea of oop?

640


Why interface is used?

555


What is abstraction with example?

609


When not to use object oriented programming?

573


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

2070