I'm trying to do the following:
int intDelay;
string timeIntDelay;
(...)
if( timeIntDelay != "" )
intDelay = atoi ( timeIntDelay );
While trying to compile I get the following error:
rtatomic.cpp: In method `RTAtomic::RTAtomic(const class string & = "RTAtomic"
':
rtatomic.cpp:51: cannot convert `timeIntDelay' from type `string' to type `const char *'
How can I get the int value from a string?!?! Isn't "atoi" the correct function?
Thanks in advance!
Eze. ---
Ezequiel Glinsky
eze@bumeran.com
Buenos Aires, Argentina
int intDelay;
string timeIntDelay;
(...)
if( timeIntDelay != "" )
intDelay = atoi ( timeIntDelay );
While trying to compile I get the following error:
rtatomic.cpp: In method `RTAtomic::RTAtomic(const class string & = "RTAtomic"
rtatomic.cpp:51: cannot convert `timeIntDelay' from type `string' to type `const char *'
How can I get the int value from a string?!?! Isn't "atoi" the correct function?
Thanks in advance!
Eze. ---
Ezequiel Glinsky
eze@bumeran.com
Buenos Aires, Argentina