Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

argc

Regarding ‘main(int argc, char *argv[])’ [duplicate]

January 5, 2023 by Tarik

The arguments argc and argv of main is used as a way to send arguments to a program, the possibly most familiar way is to use the good ol’ terminal where a user could type cat file. Here the word cat is a program that takes a file and outputs it to standard output (stdout). … Read more

Categories c Tags argc, argv, c++ Leave a comment

Why is argc not a constant?

December 31, 2022 by Tarik

In this case, history is a factor. C defined these inputs as “not constant”, and compatibility with (a good portion of) existing C code was an early goal of C++. Some UNIX APIs, such as getopt, actually do manipulate argv[], so it can’t be made const for that reason also. (Aside: Interestingly, although getopt‘s prototype … Read more

Categories c++ Tags argc, c++, constants, effective-c++, program-entry-point Leave a comment

What does int argc, char *argv[] mean?

September 10, 2022 by Tarik

argv and argc are how command line arguments are passed to main() in C and C++. argc will be the number of strings pointed to by argv. This will (in practice) be 1 plus the number of arguments, as virtually all implementations will prepend the name of the program to the array. The variables are … Read more

Categories c++ Tags argc, argv, c++, command-line-arguments, parameters Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa