May I know how to take input in my C++ program in a text editor through multi-line comments on the top of the program

Some coders use to insert multi-line comments on the top of their codes for the input of the program. I think they practice this to run their program directly on the text editor(takes input from that comment) and also on the online judge(which assumes it as comment only). I just want to know, how to do it in the text editor to make our program take input from it?
like:
/* input

—input here–

*/

Thanks in advance to the one who reply…

1 Like

not sure about that but you can input from seperate text file using
freopen(“input.txt”,“r”,stdin) ; google for more info

If you are using Sublime Text Editor then install package “Sublime Input
Link: Sublime Input - Packages - Package Control
Then you can go to user key bindings and set your desired shortcut key (I’ve set Ctrl+I because its easy to remember) for running program with sublime input and it really makes your work fast.

If you are using VS Code Editor then you can use extension “Comment Input” and there may be similar packages for other popular text editors too.

Modern Text editors like Sublime and VS Code makes writing programs easier and faster as they show suggestions, code snippets and have debugger and many other features.

Thank you :grinning: :pray:

Thank you :grinning: