Page 1 of 1

PostPosted: Tue Dec 19, 2000 3:02 pm
by bstill
Does anyone know how to convert from a string to an integer? Is this possible?

PostPosted: Tue Dec 19, 2000 3:20 pm
by guy
Do you mean convert the string "123" (say) to the integer 123?

If so you do it like this:

int i;
string s;

s = "123" ;
i = s; // Automatically converts


PostPosted: Wed Dec 20, 2000 2:55 pm
by bstill
Thanks... I thought that was what would happen, but in my test code, I did something stupid when trying to verify this...UGH!

PostPosted: Tue Jan 16, 2001 2:37 am
by bopin
I am very interested in this topic
but suppose this:
string a;
int b,c;
where b=7 and c=5
I need a function like Eval in order to convert the string "b+c" into 7+5

PostPosted: Tue Jan 16, 2001 9:53 am
by Justinespinosa
Just take a look in EGcalc. The site is on the web ring and it's open source. It's a graphic calculator.


OUTS Softwares

Edited by - Justinespinosa on 01/16/2001 03:57:30