带参数的main函数

#include <iostream>
#include <string>
using namespace std;
int main(int argc,char *argv[]){
	
	cout << "Parameter num is :" << argc << endl;
	cout << "the command is :" << argv[0] << endl;		
	cout << "Parameter list is: "<< endl;
	for(int i = 1; i < argc; i++){
		cout << "No_"<< i << "parameter is :" << argv[i] << " "<< endl;
	}	
        cout << endl; 	
		
	return 0;
}

posted @ 2011-06-19 18:57  Podevor  阅读(155)  评论(0编辑  收藏  举报