main() 的參數
(高顯忠, sjgau4311@gmail.com, 2011-04-19 09:53)
1樓
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("\n argv= %d \n", argc);
int i;
for (i=0;i<=argc;i++) {
printf("i= %3d, argv[i]= [%s] \n", i, argv[i]);
}
return 0;
}// end of main()
(高顯忠, sjgau4311@gmail.com, 2011-04-19 10:44)
2樓
// Dev-C++ 的需求
#include <cstdlib>
#include <iostream>
using namespace std;
// --------------------------------------------------------
int main(int argc, char *argv[])
{
printf("\n argv= %d \n", argc);
int i;
for (i=0;i<=argc;i++) {
printf("i= %3d, argv[i]= [%s] \n", i, argv[i]);
}
system("pause");
return 0;
}// end of main()
// --------------------------------------------------------
#if 0
int main(int argc, char *argv[])
{
printf("\n (6*7)= %d \n", (6*7));
system("PAUSE");
return EXIT_SUCCESS;
}// end of main()
#endif