In the K&R book there is a question as following:
Write a program that converts uppercase to lower and vice versa, depending on the name it is invoked with?
In the solution given, it says that when the program is invoked with the name lower, the program converts lower to upper. In the solution program argv[0] is compared with "lower" but on Linux argv[0] will be "./lower" and not "lower".
Could someone clarify that please?
Consider this test code:
If I compile it as “test_argv”, and run it, I get whatever I typed to run the program:
So you want to test the string, for example, against a regular expression, or for a substring.