WHAT DOES "int argc and char* argv[]" do?

Hi everyone, can somebody tell me what the parameters "int argc and char* argv[]" are for in the main() function. I've came across this many times and i still don't know what these two parameters do.
They are used to pass command line arguments to the program
^More specifically the int the number of arguments passed and the array of char* is the arguments themselves.
This is when the SO calls your program it sends arguments like a function.

In Windows the first argument it's always the path of program with his name. When you call the program througth line command you can put more arguments like the DOS commands dir / find / cd / etc...

this is good to script your program.
If Windows is your SO, you must lead a very, very sad life.
Meat is obsolete.
From a game programming point of view, it makes it easier to do things in your code so that if you want to test something but not worry about health or ammo or such you can pass arguments in the command line and set it so you have permanent health/ammo/etc while testing what you wanted to test.
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>

int main(int argc, char **argv)
{
	for(int i = 0; i < argc; i++)
	{
		std::cout << argv[i] << '\n';
	}
	return 0;
}

./commargs completely helpful in programming apps and debugging :D
./commargs
completely
helpful
in
programming
apps
and
debugging
:D
Topic archived. No new replies allowed.