// Needed for input and output from/to standard streams.
#include <iostream>

// Import only the necessary -> that's what namespaces are good for ;-)
using std::cout;
using std::cin;
using std::endl;

// Note: main is a function that
// returns an int and takes
// an int as its first argument
// and a pointer to a pointer to a character as its second argument.
// 
// We can also say, argv is an array of pointers to character arrays.
// Or we can say, argv is an array of pointers to "strings".
//
// Note that in C, "strings" are represented as arrays of characters.
// In C++, you can #include <string> for a much more powerful solution.
//
// [[[ More about pointers in another example file. ]]]
//
int main ( int argc, char ** argv )
{

	// argc is just a number.
	std::cout << "I have " << argc << " arguments." << std::endl;

	// We print all commandline arguments one after another.
	for ( int i = 0; i < argc; ++i )
	{
	
		// Using argv is not as painful as it might look at first sight...
		// argv[i] is the i-th argument.
		std::cout << "argv[" << i << "]: " << argv[i] << std::endl;
	
	}

	return 0;
}

