sublime taking random input while running the program

34 Views Asked by At

so i tried setting up sublime for programming today , like setting up the build system but when i try to run a normal program like the one shown in screenshot , the editor is giving me output without taking any input like it is supposed to do . the code i used for build system

{
"cmd": ["g++.exe","-std=c++14", "${file}", "-o", "${file_base_name}.exe", "&&" , "${file_base_name}.exe<inputf.in>outputf.in"],
"shell":true,
"working_dir":"$file_path",
"selector":"source.cpp"
}

enter image description here

i have tried reinstalling sublime and making the system build again but nothing seems to work , i want to know how i can fix this and make the program take input . just for context this system build is for competitive programming

1

There are 1 best solutions below

0
Sabur Islam On

this should run in a shell and to do so you can add cmd if you are using Windows

"cmd": ["cmd", "/C", "g++.exe", "-std=c++14", "${file}", "-o", "${file_base_name}.exe", "&&", "${file_base_name}.exe<inputf.in>outputf.in"],