michaelb/sniprun

help wanted, how to input a value

alavaelian opened this issue · 3 comments

#include

int main()
{
std::cout << "Introduce un entero: ";
int x;
std::cin >> x;
std::cout << "x=" << x << '\n';
}
having that code how i can input a value from the keyboard it just put automatically zero to the input so i cant put any value is there an option to do that

also if i execute the sniprun into the input line it just give a compilation error i do not know why

Unfortunately, sniprun doesn't support sending stuff to the stdin of the code snippets it runs

also if i execute the sniprun into the input line it just give a compilation error i do not know why

Probably because it considers that 'x' is not defined/declared. You should select all the relevant lines and sniprun them together, though stdin << stuff will still not work

thanks so much for the answer dude