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 8418627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:23:03+00:00 2026-06-10T02:23:03+00:00

I was trying to create a program that takes arguments by command line, using

  • 0

I was trying to create a program that takes arguments by command line, using main() function arguments. As a (basic) C++ programmer (even if I know quite well pointers and array in C-style) I hardly ever used char* strings and C-arrays. I spent some to take main() arguments and transform it in std::string… So asked myself: why in C++ the main() function is not overloaded to take an std::vector<std::string> argv instead of the old char* argv[]?

For “overload” I mean the coexistence of main() functions like int main() and int main(int argc, char *argv[]), not the overloading of a normal function made by the programmer.

  • 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-10T02:23:04+00:00Added an answer on June 10, 2026 at 2:23 am

    Why isn’t it in the standard? Simple:

    Because nobody proposed it.

    Things go into the C++ standard because someone writes a proposal for it, then gets other people to vote on it and incorporate it. Unless someone actually wants it to happen, it doesn’t get to happen.

    And considering how trivial this feature really is:

    int main(int argc, char **argv)
    {
        std::vector<std::string> args(argv, argv + argc);
        ...
    }
    

    There just isn’t any real need for it. It’s a convenience function, and it doesn’t even make things that convenient compared to the alternative.

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

Sidebar

Related Questions

I'm trying to create a program that takes a text file of c++ code
Hi i'm trying to create a sever/client program that takes up to 5 clients
I'm trying to create a simple program or function that will take the users
I am trying to create a program that will get data directly from socket
I am trying to create a program that will be passed input data from
I am trying to create a program that will do some simple calculations, but
I am trying to create a program that has one tableview and when you
I'm currently trying to create a program that estimates location based on signal strength.
I'm trying to create a c program that implements the radon transform algorithm. I
I am trying to create a Jenkins job that restarts a program that runs

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.