This is my requirement -
I have to get the inputs from Command line in the form
-des <destIP> -prot <tcp/udp> -min <minutes>
There are several programs that suggest how to parse these values through the argc and argv parameters of main() function. But I want a function which gets the iput line and then parse it.
The function would be -
void GetArguments()
{
cout << "Enter arguments ..." << endl;
cin >> inputStr;//eg: inputStr = "-des 127.0.0.1 -prot tcp -min 60"
//code to parse the input arguments and get values of dest IP, protocol and time
}
How do I get the values I need?
main()function to this function (GetArguments()). There's no other way to get the input line.