Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179
Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803
Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179
Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
Материал из C\C++ эксперт
Outputs the program name including the path, command line arguments and the environment
#include <iostream>
using namespace std;
int main( int argc, char *argv[], char *env[])
{
cout << "Program: " << argv[0] << endl;
cout << "Command line arguments:" << endl;
int i;
for( i = 1; i < argc; ++i)
cout << argv[i] << endl;
cout << "Type <Return> to go on";
cin.get();
cout << "Environment strings:" << endl;
for( i = 0; env[i] != NULL; ++i)
cout << env[i] << endl;
return 0;
}