1234567891011121314151617181920
// argv-0 // Print command-line arguments, one per line // Demonstrates use of argv #include <cstdio> #include <iostream> #include <string> using namespace std; int main(int argc, string argv[]) { // print arguments printf("\n"); for (int i = 0; i < argc; i++) { cout << argv[i] << "\n"; } printf("\n"); }
12
// int main(int argc, string argv[]) int main( int argc, char* argv[] )
main()
int main() { /* ... */ } int main( int argc, char* argv[] ) { /* ... */ }