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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:51:04+00:00 2026-06-10T11:51:04+00:00

something weird is happening to my program. I am currently using lots of threads

  • 0

something weird is happening to my program. I am currently using lots of threads in my program, and will not be feasible to paste everything here.

However this is my problem:

int value = 1000;
std::cout << value << std::endl;
//output:  3e8

Any idea why is my output 3e8?

Whats the command to fix it back to print decimal values?

Thanks in advance! 🙂

  • 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-06-10T11:51:05+00:00Added an answer on June 10, 2026 at 11:51 am

    Somewhere in your program a call such as:

    std::cout << std::hex << value;
    

    has been used. To revert output to normal (decimal) use:

    std::cout << std::dec;
    

    here is a relevent link to the different ways numbers can be output on std::cout.

    Also, as pointed out in the comments below, the standard method of modifying cout flags safely appears to be the following:

    ios::fmtflags cout_flag_backup(cout.flags()); // store the current cout flags
    
    cout.flags ( ios::hex ); // change the flags to what you want
    
    cout.flags(cout_flag_backup); // restore cout to its original state
    

    Link to IO base flags


    As stated in the comments below, it would also be wise to point out that when using IO Streams it is a good idea to have some form of synchronisation between the threads and the streams, that is, make sure no two threads can use the same stream at one time.
    Doing this will probably also centralise your stream calls, meaning that it will be far easier to debug something such as this in the future.
    Heres an SO question that may help you

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

Sidebar

Related Questions

I'm developing an app using threading, and something weird is happening. I have these
Either I'm very tired or something weird is happening that I'm not aware of,
I got something weird happening here and I can't understand why, on my php
So something weird is happening for me here... i have had borders on my
Something weird is happening, I made an EJB3 wich is suposed to write something
Something weird's happening with my Rails app. When I try to send an update
I have something weird going on here. I just finished a site for a
edit This question is solved! Having something weird. I'm using html { font-size: 100%
Something weird is happening to my views all of a sudden (resizing a UITableView
Had something weird start happening to me today. I have an asp.net mvc app

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.