|
allegro GUI |
chaseC
Member #8,368
February 2007
|
Hi, I just learned how to use d_edit_proc and was wondering how you convert the user generated string into an int format so that I could use it as a variable???? |
LennyLen
Member #5,313
December 2004
|
chaseC
Member #8,368
February 2007
|
went I use atoi in the simple program
the compile log says whatever.cpp: In function `int _mangled_main(int, char**)': whatever.cpp:16: warning: `textprintf' is deprecated (declared at C:/Dev-Cpp/include/allegro/alcompat.h:177) make.exe: *** [whatever.o] Error 1 Execution terminated
|
Steve Terry
Member #1,989
March 2002
|
a = atoi(edittext); ___________________________________ |
chaseC
Member #8,368
February 2007
|
Thanks, it works now!;D |
Matt Smith
Member #783
November 2000
|
atoi() is ancient and depecated. strtol(edittext, NULL, 10); is the modern version. There is no strong reason to change it in this particular situation, but it's good to be modern. edit: Actually, there is a good reason to use Allegro's built-in ustrtol() instead. It handles Unicode properly. |
|