M
Miro
Hello, Usenet.
I come from a background of mostly Perl and Ruby, so C++ is the first
truly low level programming language that I know. However, I have
something I'd like to ask the community about. I'm rewriting a BC-
esque terminal calculator I did in Perl. (You can find it on
SourceForge as PerlCalc, I believe.), and I've encountered a problem
that my manual book doesn't cover. In Perl, you can evaluate a string
as code like this:
#Getting the string
my $string = <STDIN>;
chomp( $string );
# Evaluate it and print it
print(eval($string));
How, pray tell, might I do that in C++?
Thanks for your help,
Miro
I come from a background of mostly Perl and Ruby, so C++ is the first
truly low level programming language that I know. However, I have
something I'd like to ask the community about. I'm rewriting a BC-
esque terminal calculator I did in Perl. (You can find it on
SourceForge as PerlCalc, I believe.), and I've encountered a problem
that my manual book doesn't cover. In Perl, you can evaluate a string
as code like this:
#Getting the string
my $string = <STDIN>;
chomp( $string );
# Evaluate it and print it
print(eval($string));
How, pray tell, might I do that in C++?
Thanks for your help,
Miro