Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4085908
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:39:00+00:00 2026-05-20T18:39:00+00:00

I have a multiple choice question about memory allocation C, but I’m sure which

  • 0

I have a multiple choice question about memory allocation C, but I’m sure which one is the right answer.

  1. Which of the following statments about releasing memory allocation is false?

    a. It is an error to dereference a pointer to allocated memory after the memory has been released.

    b. It is an error to free memory with a pointer to other than the first element of an allocated array.

    c. Memory should be freed as soon as it is no longer needed.

    d. Only one call to free is necessary to release an entire array allocated with calloc.

    e. To ensure that it is released, allocated memory should be freed before the program ends.

They all look right to me 🙁 ! Any idea?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:39:01+00:00Added an answer on May 20, 2026 at 6:39 pm

    As given by the other answers, e is the answer. The interesting option however is c which is highly subjective. There’s not necessarily any reason to free memory as soon as possible, and it’s favorable to delay this in certain circumstances.

    For example, if you know that a certain memory block will be surely re-allocated soon after it’s freed, it may cost less to simply retain it in a pointer, rather than freeing it. It would hopefully be clear in each case whether having such a retained pointer makes sense and fits within the architecture of the code (code smell!). Sometimes a minor performance loss wins over having less readable code — use your judgment and measure if unsure!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a base type which stores information about a question in a question
Take for example a multiple choice question game. You have a MathQuestion and WordQuestion
i have created a multiple choice question .it hav 3 options in a custom
I am doing an application on a Multiple Choice Question (MCQ) where I have
I have a list of 10 multiple choice questions and each question have a
I have a ListView with multiple choice entries where some are checked from the
I have multiple selects: <select id=one> <option value=1>one</option> <option value=2>two</option> <option value=3>three</option> </select> <select
We have multiple MFC apps, which use CMutex( false, blah ), where blah allows
I've not found a answer to this question anywhere, but this seems like a
I have a little multiple choice application. There are 4 green check marks and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.