I’m currently building a console app for a school project and I really need this function for my app.
How do I save all the text from console to a string in C (Windows platform)?
For example:
If I used the function system("dir"), it will output to console and list all the subdirectories and files in a directory. And I want it to be saved on a string for later use.
You could use
popen()rather thansystem():