/*
* c++取得命令行参数
*/
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main (int argc, char *argv[])
{
char * p;
for(int i=0;i<argc;i++){
p=argv[i];
while(*p!='\0'){
cout<<(char)*p;
p++;
}
cout<<endl;
}
cout << "Press ENTER to continue..." << endl;
cin.get();
return 0;
}
No comments:
Post a Comment