#include <iostream>
int main(
int argc,
char *argv[]){
cout<<argc<<endl;
if (argc<2){
cout<<"Usage: "<<argv[0]<<" -string someString --num=someNum -h"<<endl;
return -1;
}
string ret;
int i=0, j;
cout<<
"key = h: i = "<<i<<
", getArg returns "<<op.
getArg(
"h", argc, argv, ret, i)<<endl;
cout<<"argument was : "<<ret<<endl;
cout<<
"key = string: i = "<<i<<
", getArg returns "<<op.
getArg(
"string", argc, argv, ret, i)<<endl;
cout<<"argument was : "<<ret<<endl;
cout<<
"key = num: i = "<<i<<
", getArg returns "<<op.
getArg(
"num", argc, argv, j, i)<<endl;
cout<<"argument was : "<<j<<endl;
return 0;
}