Soren Bro - 2021-09-12

In PERL I can do the following using the PERL module "Term::ReadLine"


# pseudocode
use Term::ReadLine;

my $term = new Term::ReadLine('Foo: '):
my $data;

while(1) {
$data= $term->readline('Data: ', $data);
$data =~ tr/\r\n//d;
last if ($data =~ /^[qQ]$/);

#do stuff with $data

}

Here thanks to the readline function the input is autpmatically used as default.,
Is there a way to do something similar in either basic C++ or BOOST?

Regards,
 

Last edit: Soren Bro 2021-09-12