Argc(argument count) and argv(argument value) are used in main function when we are passing arguments through command line.
The first argument (argc) shows the number of elements in the array, while the second argument(argv) is the actual array.

Example
#include <iostream.h>
using namespace std;
int main(int argc, char* argv[])
{
cout << "argc = " << argc << endl;
for(int i = 0; i < argc; i++)
cout << "argv[" << i << "] = " << argv[i] << endl;
system("pause");
}


Sponsored Links