Is it bad form to use the GNU getopt in C++ programs? Is there a C++ specific alternative, or should I still just use getopt?
C allows a program to obtain the command line arguments provided when the executable is called, using two optional parameters of "main()" named "argc (argument count)" and "argv (argument vector)". The "argc" variable gives the count of the number of command-line parameters provided to the program.
What are Command Line Arguments in C? Command line arguments are nothing but simply arguments that are specified after the name of the program in the system's command line, and these argument values are passed on to your program during program execution.
There is nothing wrong with using getopt. There are a multitude of object oriented alternatives floating around including Boost.Program_options, and classes in POCO, and ACE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With