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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:04:19+00:00 2026-05-23T02:04:19+00:00

concerning this question on how to allocate memory without using new or malloc, suppose

  • 0

concerning this question on how to allocate memory without using new or malloc, suppose I have a structure linked list

struct stack {
 string info;
 stack next*;

};

The answer provided says use global byte array. How would I implement an linked list by allocating to global byte array?

  • 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-23T02:04:20+00:00Added an answer on May 23, 2026 at 2:04 am

    One way is to have a memory pool declared in data segment and have your own memory allocation function.

    char myMemoryPool[10000000]; // global variable (can be enclosed in namespace)
    

    And you have to write your own memory manager:

    void* MyMemoryAlloc (size_t SIZE)
    {
     //... use SIZE
    }
    

    Usage:

    A* p = (A*)MyMemoryAlloc(sizeof(A) * 3);
    

    Or more precisely,

    template<typename T>
    T* MyMemoryAlloc (unsigned int UNITS)
    {
    //... use (sizeof(A) * UNITS)
    }
    

    Usage:

    A *p = MyMemoryAlloc<A>(3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question concerning this code which I want to run on QNX:
This question is similar to another one, concerning pyCURL I have the following error
This is a really simple question concerning a method. I'm pretty new to C#
This is a very complicated question concerning how to serialize data via a web
This is a general question concerning technology decisions for a product development. My aim
this is a different question concerning: add a connection to database not working, asp.net
This is a question concerning what is the proper way to synchronize a shared
I have a question concerning fgets and fscanf in C. What exactly is the
Inspired by this question. Why is there no list.clear() method in python? I've found
this is a bit related to this question . I'm using make to extract

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.