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 6871531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:49:03+00:00 2026-05-27T03:49:03+00:00

I know a contiguous block of memory is allocated for an array. My first

  • 0

I know a contiguous block of memory is allocated for an array.

My first question is when the array element is an object rather than a built-in type, what gets stored in the contiguous memory reserved for the array? Pointer for the object or the actual data for the object? My guess is pointers are stored in the array and the actual objects are stored randomly in the heap. Am I correct?

My second question is now we want to reserve a specified memory(e.g., shared memory) for an array of objects. What is the best way to achieve this? Should I serialise the actual objects in the specified memory one by one and use relative pointers(e.g., indices) to access each of them?

  • 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-27T03:49:04+00:00Added an answer on May 27, 2026 at 3:49 am

    Not at all correct. An array T[N] contains N elements of type T, directly stored in contiguous memory. The array occupies N * sizeof(T) bytes of memory.

    Conversely, to answer your second question, any run of N * sizeof(T) bytes of memory can be used to hold N elements of type T (subject to some alignment constraints perhaps).

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

Sidebar

Related Questions

For an assignment, I have to allocate a contiguous block of memory for a
Know this might be rather basic, but I been trying to figure out how
http://msdn.microsoft.com/en-us/library/ms379570(v=vs.80).aspx I know that Arrays in .net is stored in a contiguous fashion. (
How can I find the largest increasing (non-contiguous) subset of an array? For example,
I want to find a nonempty, contiguous subarray for a given input array of
I know that every running process has pages associated with it in virtual memory
I believe that the question Is there a good way to do this type
I'm trying to implement dynamically allocated contiguous 3D arrays in a C code. The
I know that using continuous integration improves the quality of my code base, and
Know of an OCAML/CAML IDE? Especially one that runs on Linux?

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.