- Related Questions & Answers
C C Server Side Programming Programming argc stands for argument count and argv stands for argument values. These are variables passed to the main function when it starts executing. When we run a program we can give arguments to that program like −. Int main(int argc, char. argv) int main(int. argc, char. argv) The above two declarations convey same meaning. These two declarations are also a part of the current C standard. We use this when we need to pass command line arguments to the main function. It accepts two parameters argc and argv and returns an integer.
- Selected Reading
argc stands for argument count and argv stands for argument values. These are variables passed to the main function when it starts executing. When we run a program we can give arguments to that program like −
Example
Dev C++ 5.11
Here hello is an argument to the executable. This can be accessed in your program. For example,
When you compile and run this program like −
Output
This will give the output −
This program has 3 arguments
Dev C++ Download Windows 10
Note that the first argument is always the location of the executable executing.