N
noridotjabi
I'm working on a prompt style thing and I need a way to pass arguments
to commands within my program. For example:
::hello -v -r -n
If this is entered as one input string, can I (in any simple way) break
it apart so I have something like:
str[0] = "hello"
str[1] = "-v"
str[2] = "-r"
str[3] = "-n"
This way say I had a command connect I could do this:
::connect 0.0.0.0 0
And later use this to connect to the internet by saying okay str[0] =
"connect" so connect str[1] = "0.0.0.0" so connect to 0.0.0.0 str[2] =
"0" so connect to 0.0.0.0 on port 0. Thanks.
Nori
P.S. My question is not related to network programing it was simply an
example. I am well aware how to code this on my own I just need some
way to get input from the user properly.
to commands within my program. For example:
::hello -v -r -n
If this is entered as one input string, can I (in any simple way) break
it apart so I have something like:
str[0] = "hello"
str[1] = "-v"
str[2] = "-r"
str[3] = "-n"
This way say I had a command connect I could do this:
::connect 0.0.0.0 0
And later use this to connect to the internet by saying okay str[0] =
"connect" so connect str[1] = "0.0.0.0" so connect to 0.0.0.0 str[2] =
"0" so connect to 0.0.0.0 on port 0. Thanks.
Nori
P.S. My question is not related to network programing it was simply an
example. I am well aware how to code this on my own I just need some
way to get input from the user properly.