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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:33:15+00:00 2026-05-17T02:33:15+00:00

The way automatic variables/local variables go on to stack,dynamically allocated objects/data type go on

  • 0

The way automatic variables/local variables go on to stack,dynamically allocated objects/data type go on to heap; where is the memory for library function calls (say printf()) allocated. In which segment?

  • 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-17T02:33:16+00:00Added an answer on May 17, 2026 at 2:33 am

    Static linking

    For a statically linked program, library code is merged in with the application and almost all of the distinction between program and library is lost, i.e., each object ends up in the same section that a similar object in the main program would occupy.

    Dynamic linking

    For dynamically linked programs, if an object is writable and not automatic then memory pages will be allocated in each process that uses the library and a data section (or sections) will exist just for the dynamically loaded libraries.

    Auto

    Automatic variables are allocated on the stack in the same way for the main program, statically linked library functions, and dynamic libs. The linking process doesn’t have any role in this, rather, the generated code simply subtracts a specific amount from the stack pointer for each routine’s local automatic space requirements.

    Local non-auto

    Local static variables are allocated by the linker in the way as module-static and global addresses, they just don’t have globally linkable names.

    Heap

    Finally, library routines will link with the same malloc() (or whatever) and so all heap allocations will be made in the same way from the same group of addresses.

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

Sidebar

Related Questions

I'm experiencing a bit of cognitive dissonance between C-style stack-based programming, where automatic variables
Is there an automatic way I can use to rename a pylons controller? If
I'm looking for an automatic way in eclipse to reformat curly braces to K&R
I would like to know if there's an automatic way of knowing when the
When plotting a graph with a discontinuity/asymptote/singularity/whatever, is there any automatic way to prevent
Is there any way to trigger mysql functions automatic on specific time? on mysql
Is there a way in rst to have automatic header numbering ? That is
I'm looking for a way to create an automatic forwarder (web-browser userscript) if a
We have a huge code base, where methods with too many local variables alone
I am interested to find out what is the memory limit for the automatic

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.