Sublime Forum

Problem with input in C++ on MacOS

#1

#include
using namespace std;
int main() {
int n;
cout << “Enter your number” << endl;
cin >> n;
cout << "Your number is " << n;
return 0;
}

After I build my program, it stops at “Enter your number”, then I write the number, but the program never continiues.

How do I solve this problem, so that i could input in sublime text 4.

0 Likes

#2

Build systems in Sublime don’t support interactivity unless you use some third party package. You either need to run your program externally, or install a package like Terminus and modify your build to use it.

Instructions for that can be found here:

0 Likes