
October 23rd, 2004, 01:02 AM
|
|
Contributing User
|
|
Join Date: Sep 2004
Posts: 30
Time spent in forums: < 1 sec
Reputation Power: 9
|
|
|
How can I get a float value from the comand line?
Hello all. Would you guys help a poor and tired student with an idea or point him to the right dirrection?
int main(int argc, char *argv[])
i do c++ in LINUX. i have a comand line which looks like this
myprog -a[0.2] -b[0.04] ....
I need to extract values in between brackets and saved them into the coresponding float variables. I can point to the number, but then?
float a, b ....
uhm. how can I convert a char into float? any easy way? any libraries that do that?
or suppose I have *p="0.01";
how can i turn this into float and save it to 'a'?
Thanks a lot
|