For example, I write 'std :: cout << 5'. How do I then read this value from the console? Upd: do not enter it yourself, but consider what has already been output. What does it matter which program? If only the value remains ... Comments from the mobile do not work
|
1 answer
judging by the question, does your program need access to the output history?
then you need to implement your input / output streams: my :: out, which stores a copy of the data in memory (a typical implementation is a ring buffer), and my :: in, which can climb into the buffer with old data.
|
int n;then initializestd::cin>>n;from the keyboardstd::cin>>n;and then, if desired, display usingstd::cout<<n;If I understood correctly. - Semyon Shelukhin|redirect her output to your input and do not suffer :) - Harry