J
John Hanley
What is the easiest way to parse out a number from a command line string?
eg. PARAM=5
I tried using strchr to get to '=' then a strtod on the remainder of the
string.
eg. strtod(strchr(argc[2],'='),NULL);
It works, but I get some really weird segfault stuff on areas of my program
that previously worked fine.
Perhaps I am using it wrong, or perhaps I am completely off base with the
solution.
Also, would getopt() somehow work for this?
I am programming in C for DOS.
Ideas?
Thanks a bunch!
eg. PARAM=5
I tried using strchr to get to '=' then a strtod on the remainder of the
string.
eg. strtod(strchr(argc[2],'='),NULL);
It works, but I get some really weird segfault stuff on areas of my program
that previously worked fine.
Perhaps I am using it wrong, or perhaps I am completely off base with the
solution.
Also, would getopt() somehow work for this?
I am programming in C for DOS.
Ideas?
Thanks a bunch!