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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:09:48+00:00 2026-05-23T14:09:48+00:00

I am assigning std::ostream *pout_ = output_.get(); where output_ is scoped_ptr<std::stringstream> output_; after assigning

  • 0

I am assigning std::ostream *pout_ = output_.get();
where output_ is scoped_ptr<std::stringstream> output_;

after assigning i am filling *pout_ <<"large strings"; appx 1172528 characters.

But after some extent i am not able to insert charcters inside *pout_. I tried surfing on the net whats the maximum size of this class but couldn’t find.

Someone please tell how much characters maximum i can store in *pout_. Is there any function which can tell me the maximum size of this class??

  • 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-23T14:09:48+00:00Added an answer on May 23, 2026 at 2:09 pm

    There are several possible causes for output to an ostream to fail.
    The most obvious is that the underlying supporting media (memory, in the
    case of an std::ostringstream) is full. Another is that you’ve
    reached some internal limit: a lot of systems have (or had) file size
    limits which would hit you long before the disk was full, and some
    systems have had similar constraints on single objects in memory (and
    the std::stringbuf class typically keeps its data in a single object).
    (There’s also the possiblity of a hardware error, but if this occurs
    with std::stringbuf, i.e. a memory error, the hardware probably won’t
    detect it.)

    All of these mean that there is no hard limit as to how much you can
    write to a stream, string or otherwise. It all depends, and one time,
    you might succeed writing 2 GB, and the next fail after 1 MB or less.
    Practically speaking, in most cases, you should be aware of the fact
    that writes can fail, test the results (after a final flush) and be
    prepared to do something reasonable if they do.

    In the specific case of string streams, of course, about the only
    failure you’re likely to be able to detect is out of memory. (An
    ostream does not propagate an exception from the streambuf; it
    sets the badbit when one occurs, and if exceptions have been activated
    for badbit, it will throw its own exception, not rethrow the original
    one. Which means that an std::bad_alloc will not propagate out.)
    A lot of applications don’t handle out of memory, and should logically
    have set the new handler to abort. If you’ve set the new handler to
    abort, then you can probably forego such error checking on string
    outputs.

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

Sidebar

Related Questions

After assigning RadGrid.DataSource to a Linq Query on postback DataSource is null. Is it
Incompatible pointer types assigning to NSObject *__weak from NSObject When using MGTwitterEngine I get
When assigning a method to a Func -type, I get the compilation error Type
after assigning loaded XML data to an array of objects, i would like to
Assigning a Date variable to another one will copy the reference to the same
I'm interested in assigning the tag name of the root element in an xml
I am assigning ViewState[something] in Page Load of content page and when I try
If I am assigning an event handler at runtime and it is in a
I am assigning to an ImageView contacts images using this code: mPhotoView = (ImageView)
Need some help assigning a mouseover event to display some icons that start out

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.