On Sat, 4 Jul 2020 at 21:41, Shrivani . <Shrivani@xxxxxxxx> wrote: > > Hello Team > > The following std::cout results in termination of the program. > > std::stringstream string_1, string_2; > std::cout<<string_1.str()<< int_1<<" "<<string_2.str()<<std::endl; Similar code works for everybody else, so you must be doing something wrong (maybe you have a bug elsewhere in your program which is corrupting the program's memory or the I/O streams). You didn't show a complete example though, so we have no idea what the rest of your program does. I suggest you try the steps recommended before reporting a bug: "Before reporting that GCC compiles your code incorrectly, compile it with gcc -Wall -Wextra and see whether this shows anything wrong with your code. Similarly, if compiling with -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations makes a difference, or if compiling with -fsanitize=undefined produces any run-time errors, then your code is probably not correct." You could also try -fsanitize=address or valgrind to check for memory errors (but don't use valgrind on code compiled with -fsanitize=address, use one at a time).