Hi,
I have a c++ program that handles serial communications. At this stage, serial settings (ports, baud rate, settings) are hard-coded into the program.
I'd like to re-build the program so that it will take in options/flags to control each of the settings, such as
Code:
c:\user\command.exe -p 5 -r 115200
the command above will listen on COM5 at rate 115200
I've been reading about command line arguments, and I've tried to play with it like this:
Code:
int main(int argc, char **argv)
{
switch (argv[1])
.......
}
butswitch statement doesn't allow checking char data type.
any insight will be so helpful!!
thanks!!!