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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:01:45+00:00 2026-05-20T22:01:45+00:00

I have a really weird issue with my cout statements. I’ve only tried this

  • 0

I have a really weird issue with my cout statements. I’ve only tried this out with XCode 4. For instance, if I write,

cout << "this works" << endl;
cout << "this doesnt";
cout << memorySizeLimit << " blocks of memory available." << endl;

I see all three output statements in my debugger console. However, if I change the order to,

cout << memorySizeLimit << " blocks of memory available." << endl;
cout << "this works" << endl;
cout << "this doesn't";

I only see the first two couts. Even stranger, if I change the code to,

cout << memorySizeLimit << " blocks of memory available." << endl;
cout << "this works" << endl;
cout << "this doesn't" << endl;

I see all three statements.

Why would I not see that “this doesn’t” cout statement when I change its position?

  • 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-20T22:01:46+00:00Added an answer on May 20, 2026 at 10:01 pm

    std::cout is an stream and normally it is buffered for performance. If you print endl the stream gets flushed (cout << endl is the same as cout << "\n" << flush.

    You may flush the stream manually by cout << flush (or cout.flush()).

    So that should print:

    cout << "this doesn't" << flush;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird issue with my CSS. Really can't figure this one out.
I have a really weird issue that I can't figure out with comparing objects
Ok, this is a really weird one. I have an MPI program, where each
this seems to be weird but it really happened. I have this code working
I seem to have stumbled across a really weird issue when posting a static
I have a really weird issue with Sql queries on unicode data. Here's what
I'm seeing a really weird issue with this code and sample execution: https://gist.github.com/720278 The
I am having this really weird issue with downloading files from within ASP.Net MVC
I have a really weird issue with Combobox in WPF. I have used it
I have a really weird issue with an SQL query I've been working with

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.