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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:32:13+00:00 2026-05-14T07:32:13+00:00

I have the following piece of snippet Class Sample { Obj_Class1 o1; Obj_Class2 o2;};

  • 0

I have the following piece of snippet

Class Sample
{ Obj_Class1 o1;
  Obj_Class2 o2;};

But the size of Obj_Class1 and Obj_Class2 is huge so that the compiler shows a warning “Consider moving some space to heap”. I was asked to replace Obj_Class1 o1 with Obj_Class1* o1 = new Obj_Class1(); But I feel that there is no use of making this change as heap allocation will also fail if stack allocation fails. Am I correct? Or does it make sense to make this change ( other than suppressing the compiler warning ).

  • 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-14T07:32:13+00:00Added an answer on May 14, 2026 at 7:32 am

    It is very typical that the stack is smaller than the heap. They use different memory locations. The stack is typically about a megabyte in size (you can change it, but be careful) and is allocated per thread. The heap can consume gigabytes if needed.

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

Sidebar

Related Questions

I have the following piece of code in Visual C++ 2005 : : class
I have the following piece of code in my DataModel.cs class: public User ValidateUser(string
I have the following snippet of java code: final Class<?> junitCoreClass = AccessController.doPrivileged( new
I have the following piece of SQL code that does the following: Obviously looks
I have the following piece of code its working fine,no issues but i am
I have the following piece of JS code within a function that responds to
I have the following piece of JS code within a function that responds to
I have the following piece of code in a file that I opened in
I have the following snippet of a HTML select box: <select id=Obj_cboscreen class=menubarselect name=page>
I have following piece of code: class Test{ private: int id; public: Test(int v):id(v)

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.