How do I take inputs in Sublime Text for C++?

How to take input in sublime text editor for cpp ? 

Go to TOOLS > BUILD SYSTEM > NEW BULD SYSTEM .



Now delete that code and copy this code and paste.

Code :-


{

    "cmd": ["g++.exe", "-std=c++14", "-o", "$file_base_name", "$file", "&&", "start", "cmd", "/c", "$file_base_name & echo. & echo. & pause"],

    "shell": true,

    "selector": "source.c++"

}

[Code source :- https://gist.github.com/nktstudios/fd1865492dd3ed97ff3bc4863cc6ecb3 ]


Now go to FILE > SAVE AS and save file as "cpp.sublime-build" .

Now take note here you can use any name for your flie but save file as "YOUR_NAME.sublime-build".



After this close your sublime editor and open again.

Open your cpp code and press ctrl + shift + b and select cpp (in your case it will show whatever name you given) and that will open direct command prompt (cmd) .





Comments

Popular Posts

Set the time using four switch and display the clock on LCD using arduino ** SW1 : when press, increment 1 digit ** SW2 : when press, decrement 1 digit ** SW3 : when press, display set time and start the clock ** SW4 : when press, reset the clock

Connect switch to Arduino. If switch is on than print ”ON” else print “OFF” on serial monitor.

Interface 4 push button with arduino & do following: ** SW1 : when press, display 0 to 9 on LCD ** SW2 : when press, display 00 to 99 on LCD ** SW3 : when press, display 000 to 999 on LCD ** SW4 : when press, display 0000 to 9999 on LCD