string to int conversion

Discuss PocketC for CE (including Desktop Edition)

Postby bstill on Tue Dec 19, 2000 3:02 pm

Does anyone know how to convert from a string to an integer? Is this possible?
Posts: 10
Joined: Tue Dec 19, 2000 3:01 pm

Postby guy on Tue Dec 19, 2000 3:20 pm

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

PocketC CE API interface:
PCForm and CE API forum:
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby bstill on Wed Dec 20, 2000 2:55 pm

Thanks... I thought that was what would happen, but in my test code, I did something stupid when trying to verify this...UGH!
Posts: 10
Joined: Tue Dec 19, 2000 3:01 pm

Postby bopin on Tue Jan 16, 2001 2:37 am

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
Posts: 2
Joined: Tue Jan 16, 2001 2:28 am
Location: Colombia

Postby Justinespinosa on Tue Jan 16, 2001 9:53 am

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

OUTS Softwares
Posts: 156
Joined: Wed Dec 06, 2000 2:30 pm
Location: Switzerland

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 2 guests