Sublime Forum

Sublime Text isn't showing correct output of C++ program


Hey Everyone,
I need a help, actually I’m using Sublime text 3 for competitive programming for a long time and for me, it’s the best code editor ever.
I use C++ language for coding. Suddenly it started showing some irrelevant values in output file.

freopen("", "r", stdin);
freopen("", "w", stdout);

As we know, we use the above code while coding in editor in our local machine( for C++). previously I didn’t used that code yet my all programs ran perfectly.
Since the problem occurred it started showing something like, even it’s a hello world program.

Code Sample
#include< iostream>
using namespace std;
int main()
cout<<“Hello, world”;
return 0;
4865 6c6c 6f2c 2077 6f72 6c64

As of now if I include the following stuff,

freopen(“”, “r”, stdin);
freopen(“”, “w”, stdout);

in main function, then it stops showing the output now.
It’s a great problem for me since this I’m unable to code. I searched on Google yet I couldn’t get any solution. so I’m depend on the community please help asap.



Those lines will make the problem use the and files for input and output. You won’t see output in the console because you’re redirecting it to a file.



May you please elaborate more, what exactly should I write?
I couldn’t understand that much, please :pray:



Those lines of code are sending the output to a file called instead of the console.