I wrote a little program which prints help information if argument is not passed.
If I run the app without arguments
./myApp
it prints
./myApp --filename=file
I know that argv[1] holds the first parameter, but I can’t figure out how to fetch the text after “=” ie the name of file.
Instead of parsing the string manually, you should rather use
getopt()orgetopt_long().They do the dirty work for you and behave in the way people expect it (while self-written parsers are sometimes confusing – some use
--arg value, others--arg=value, some even use-arg value)