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

  • Home
  • SEARCH
  • 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 105807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:29:50+00:00 2026-05-11T01:29:50+00:00

I am trying to figure out how C and C++ store large objects on

  • 0

I am trying to figure out how C and C++ store large objects on the stack. Usually, the stack is the size of an integer, so I don’t understand how larger objects are stored there. Do they simply take up multiple stack ‘slots’?

  • 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. 2026-05-11T01:29:51+00:00Added an answer on May 11, 2026 at 1:29 am

    The stack is a piece of memory. The stack pointer points to the top. Values can be pushed on the stack and popped to retrieve them.

    For example if we have a function which is called with two parameters (1 byte sized and the other 2 byte sized; just assume we have an 8-bit PC).

    Both are pushed on the stack this moves the stack pointer up:

    03: par2 byte2 02: par2 byte1 01: par1 

    Now the function is called and the return addres is put on the stack:

    05: ret byte2 04: ret byte1 03: par2 byte2 02: par2 byte1 01: par1 

    OK, within the function we have 2 local variables; one of 2 bytes and one of 4. For these a position is reserved on the stack, but first we save the stack pointer so we know where the variables start by counting up and the parameters are found by counting down.

    11: var2 byte4 10: var2 byte3 09: var2 byte2 08: var2 byte1 07: var1 byte2 06: var1 byte1     --------- 05: ret byte2 04: ret byte1 03: par2 byte2 02: par2 byte1 01: par1 

    As you see, you can put anything on the stack as long as you have space left. And else you will get the phenomena that gives this site its name.

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

Sidebar

Ask A Question

Stats

  • Questions 104k
  • Answers 104k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer what I would suggest you is to take a look… May 11, 2026 at 8:37 pm
  • Editorial Team
    Editorial Team added an answer You would most likely want to override WndProc and handle… May 11, 2026 at 8:37 pm
  • Editorial Team
    Editorial Team added an answer Well, that depends, doesn't it? You should sanitize everything you… May 11, 2026 at 8:37 pm

Related Questions

I need a Rolling hash to search for patterns in a file. (I am
I'm learning C#. From what I know, you have to set things up correctly
I'm struggling to create a generic (or untyped) array in C (I'm aware that
Having read Setting up Subversion on Windows I am trying to figure out how

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.