I do not think that stdin is supported in Sublime Text, however you can create the stdin.input file and use it under the editor:
#include <iostream> #include <fstream> #define SUBLIME #if defined SUBLIME # define ISTREAM ifile #else # define ISTREAM std::cin #endif int main() { int a, b, c; std::cout << "Enter: "; #if defined (SUBLIME) std::ifstream ifile("stdin.input"); #endif ISTREAM >> a >> b; c = a + b; std::cout << a << '+' << b << '=' << c << std::endl; return 0; }
perreal
source share