Really dumb question but new to atom and i am not able to get input from user for my program. Please help!


#1

Consider the following simplest C++ program :

int main() {
int x=0;
cout<<“Enter a value”;
cin>>x;
cout<<"you entered "<<x;
return 0;
}

Running this using a package named script (link : https://atom.io/packages/script)

It just keeps waiting for my input but doesn’t show me any way to provide the input. What to do here? All I want is just run my cpp program.


#2

To capture user input you essentially need full REPL (read-eval-print loop) support and it appears script does not have this yet:


#3

Ohh… So are there any other packages to run/debug cpp programs?


#4

I honestly have no idea, I don’t write C++. I did a quick search on https://atom.io/packages for CPP, but I didn’t find anything that does what you are looking for. Perhaps a better keyword has more luck, or maybe someone else knows of a package that does this?


#5

Yea i too found nothing… anyways thanks for helping!


#6

I also found run-file. I don’t use it myself, though, so I don’t know if it supports stdin.

PS Oh, and it’s only for Linux


#7

Yup saw that… Need something for mac! Thanks anyways. :slight_smile:


#8

Is there any solution to this ?
I am facing the same problem, please tell.


#9

You’re asking the same thing in two different threads. I’ve provided a response here. In the future, please pick just one thread to post in.


#10

You can try the packages names"Hydrogen" which provides stdin