g++ main.cpp > output.txt
ok, i can do it by terminal, is there an option to include the command " > aaa.txt " inside code::blocks?You can easily achieve his: Setup as tool that (using macros) will always start your projects/targets executable. Then configure to pipe the standard out to an internal console. From here, you can easily copy/paste the std::cout as you like.