What is difference between new and malloc?

Answer Posted / harsh

the difference between malloc and new is just that when a
variable is declared using malloc, it requires type casting
while new operator whenever used does not type cast by
itself as there is no need for the variable to be typecasted
when used with new operator

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by overloading?

592


What is class in oop with example?

631


Whats is abstraction in oops?

598


What is a null tree?

642


What are the benefits of interface?

589






What is polymorphism what is it for and how is it used?

580


What is encapsulation in oop?

613


Can we define a class within the interface?

567


What is interface? When and where is it used?

1671


What is use of overloading?

618


Whats oop mean?

607


What is purpose of inheritance?

653


What does I oop mean?

627


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1426


Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.

711