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,
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,
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,
Log in to post a comment.
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]$/);
}
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?
Last edit: Soren Bro 2021-09-12