How to deal with freopen and system | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 4

How to deal with freopen and system

Every time I use freopen to print something in a txt file and then use freoepn("CON","w",stdout) to get the things back to the exe windows it works every well. But if I add a system order such as system("pause") or system("CLS") something like this , it just won't print a new line no matter if I type cout<<endl or printf("/n"). Why and how to deal with it ?

28th Jan 2018, 3:29 AM
ChipmunKyle
1 Réponse
+ 1
I'm not sure I understand what you are trying to do and what the problem is. Could you show some code and explain what behaviour is unwanted?
8th Feb 2018, 10:57 PM
Freddy