1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Y_Kistochka [10]
3 years ago
15

Analyze and write a comparison of C's malloc and free functions with C++'s new and delete operators. Use safety as the primary c

onsideration in the comparison
Computers and Technology
1 answer:
Alisiya [41]3 years ago
5 0

Answer:

The C's malloc and free functions and the C++'s new and delete operators execute similar operations but in different ways and return results.

Explanation:

- The new and delete operators return a fully typed pointer while the malloc and free functions return a void pointer.

-The new and delete operators do not return a null value on failure but the malloc/free functions do.

- The new/delete operator memory is allocated from free store while the malloc/free functions allocate from heap.

- The new/delete operators can add a new memory allocator to help with low memory but the malloc/free functions can't.

- The compiler calculates the size of the new/delete operator array while the malloc/free functions manually calculate array size as specified.

You might be interested in
If you are interested in working for a specific company, what type of job site should you look at for opening?
Ainat [17]

Answer:

if you are finding to be a pilot you can find it at jinnah airport

Explanation:

3 0
3 years ago
A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
GREYUIT [131]

Answer:

import java.util.Scanner;

public class LabProgram {

  public static void main(String[] args) {

      Scanner scnr = new Scanner(System.in);

      int inputYear;

      boolean isLeapYear;

      isLeapYear = false;

      inputYear = scnr.nextInt();

      // If a year is divisible by 400,  then it is a leap year

      if (inputYear % 400 == 0)

          isLeapYear = true;

      // If a year is divisible by 100,  then it is not a leap year

      if (inputYear % 100 == 0)

          isLeapYear = false;

      // If a year is divisible by 4,  then it is a leap year

      if (inputYear % 4 == 0)

          isLeapYear = true;

      if(isLeapYear)

          System.out.println(inputYear + " is a leap year.");

      else

          System.out.println(inputYear + " is not a leap year.");

  }

}

Explanation:

  • Take the year as an input from user and store it to inputYear variable.
  • If the year is a century year, check if the year is divisible by 400 ( the year must be evenly divisible by 400 ),  then set the boolean isLeapYear to true. If a year is divisible by 100,  then set the boolean isLeapYear to false. If a year is divisible by 4,  then set the boolean isLeapYear to true.
  • Check if isLeapYear is true, then print that it is a leap year. Otherwise, print that it is not a leap year.

Output:

1712

1712 is a leap year.

4 0
3 years ago
Read 2 more answers
What is the full form of RAM. ​
grigory [225]

Random Access Memory

7 0
3 years ago
Read 2 more answers
Drag each tile to the correct box. Shawn has been assigned to create a storyboard for an online grocery website. Organize the st
defon

Answer:  I believe the correct order is:

    Create a box and title it as the “Home Page”  →   Branch out pages and specify navigation flow  →  Gather information such as text and images   →   Determine the title, heading, and content for each page  →   Draw a layout of each web page with its elements.

Explanation:  It makes sense, you start with your "Home Page", then you follow the steps of planning to map out your site's navigation. You have to gather information about it before you have enough knowledge about it to determine the title, heading, and content.  You also need to know the content to create a clean and workable layout for the page.

6 0
3 years ago
Read 2 more answers
Create a script that asks for the visitor's weight in pounds and his/her height in inches. The program should then calculate the
Nookie1986 [14]

Answer:

weightPound = float(input("Enter your weight in pounds "))

heightInches = float(input("Enter your height in inches "))

weightKg = weightPound*0.453592

heightMeter = heightInches*0.0254

BodyMassIndex = weightKg/(heightMeter*heightMeter)

print("")

print("Your Weight in kilograms is: ")

print(weightKg)

print("Your Height in meters is: ")

print(heightMeter)

print("Your Body Mass Index is: ")

print(BodyMassIndex)

Explanation:

  1. Above is a Python Script to accomplish the task
  2. See attached image for the program output.
  3. Observe that we used the formula weight/height*height to calculate the Body Mass Index
  4. Observe also the conversion from pounds to Kilogram and inches to meters

6 0
3 years ago
Other questions:
  • Which function can you use to abbreviate the lengthy expression, A1+A2+A3+A3...+A19+A20?  MAX COUNT SUM ROUND
    10·2 answers
  • 1.
    5·2 answers
  • The point at coordinates (2, -18) is in what direction from the origin?
    7·1 answer
  • The section called Breaking Substitution Ciphers (p. 166) describes a "random substitution cipher," in which each letter of the
    11·1 answer
  • Where is authorization management app on tablet?
    7·1 answer
  • The use of electronic media, information, and communication technologies to deliver instruction where students are not required
    8·1 answer
  • Micheal has increased the contrast of the given picture. Which feature or menu option of a word processing program did he use? A
    15·1 answer
  • IT professionals should help to protect users’ personal information, such as bank account information or Social Security numbers
    14·1 answer
  • Which of the following is a valid c++ identifier a. mouse b. _int c. 2_stop d. float​
    10·1 answer
  • Which of these technologies has been most used by terrorist organizations?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!