Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8179363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:59:07+00:00 2026-06-06T23:59:07+00:00

In the K&R book there is a question as following: Write a program that

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:59:08+00:00Added an answer on June 6, 2026 at 11:59 pm

    Consider this test code:

    #include <stdio.h>
    int main(int argc, char** argv) {
      printf("ARGV[0] = %s\n", argv[0]);
    }
    

    If I compile it as “test_argv”, and run it, I get whatever I typed to run the program:

    % ./test_argv
    ARGV[0] = ./test_argv
    % test_argv
    ARGV[0] = test_argv
    % /tmp/test_argv
    ARGV[0] = /tmp/test_argv
    

    So you want to test the string, for example, against a regular expression, or for a substring.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've been reading through the K&R C book and have a question.. in
There is a statement in the foudations of Qt Development book that goes as
I was reading a book on C today, and it mentioned that the following
I am reading K&R book, on page 63 there is a line while (--lim
I have read in the K&R II C Programming ANSI C book that the
i just was asking about the existence of a headfirst book(iPhone&iPad development) which covers
Code in the book Beginning iPhone Development (by Dave Mark & Jeff LaMarche) assigns
In K&R ANSI C book, section A.7.4.5 (Unary Minus Operator) it is stated: ...
I recently bought Bob's book Delphi XML, SOAP & Web Services in page 85
I came across this in the book: wscanf(L%lf, &variable); where the first parameter is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.