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

  • Home
  • SEARCH
  • 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 8320229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:35:16+00:00 2026-06-08T22:35:16+00:00

I am reading codes of mcachefs and could not understand some codes, like below:

  • 0

I am reading codes of mcachefs and could not understand some codes, like below:

printf("mcachefs " __MCACHEFS_VERSION__ " starting up...\n");

if (argc == 1 || argv[1][0] == '-')
{
    fprintf(stderr,
        "\tError : first argument shall be the the mcachefs_mountpoint !\n");
    exit(2);
}

I have two questions:
1: For printf("mcachefs " __MCACHEFS_VERSION__ " starting up...\n"), is it the correct way to use printf? I have never seen such way of using it.

  1. What is the meaning of argv[1][0]? I know argv[] represents the arguments from the command line. But, is not it a one dimension array?
  • 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-08T22:35:18+00:00Added an answer on June 8, 2026 at 10:35 pm
    1. When the C compiler sees a lot of string literals next to each other, it concatenates them into one long string. So that use of printf() is OK, as long as the macro __MCACHEFS_VERSION__ expands to a string. That string had better not contain any percent characters… I’d write it as

      printf("mcachefs %s starting up...\n", __MCACHEFS_VERSION__);

    2. As others have pointed out, argv[1] is the second string in the string array argv, and strings are character arrays so argv[1][0] is the first character in the second string.

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

Sidebar

Related Questions

While reading codes of my group project, I come across many DEFINEs, and some
Recently, I am reading some Linux kernel space codes, I see this uint64_t used;
These days I am reading some javascript source codes,however I found some syntax that
i am new to sockets and i am learning/reading some epoll materials and codes.
I have been reading a lot about QR codes and how the code itself
Note: This code actually codes from a tutorial book I'm reading at the moment,
Context Sometimes, I like reading code on paper rather than on screen (so I
Reading existing code at work, I wondered how come this could work. I have
I`m reading the code of some open source project. I see that in one
Reading PayPal developer documentation (and this is a lot of documentation) I'm not sure

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.