Q:

integer producing hex values error

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! :)

A:

Some other thread changed the default output radix of the std::cout stream to hexadecimal. Note that 100010 = 3e816, i.e. 1000 == 0x3e8.

A:

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

A:

Chances are that another thread has changed the output to hex on cout. I doubt that these streams are thread-safe.

