main()之前做点什么 Veröffentlicht am 2016-05-26 123456789101112#include <iostream>using namespace std;int main() { cout << "m" << endl;}void Main() { cout << "M" << endl;}int a = (Main(), 0); 1234➜ before-main ./1 Mm➜ before-main 12345678910111213141516#include <iostream>using namespace std;int main(int argc, char *argv[]) { cout << argc << endl; for(int i = 0; i < argc; i++) cout << argv[i] << endl;}int argc = 3;char *argv[] = {(char*)"M", (char*)"MM", (char*)"MMM"};void Main() { main(argc, argv);}int a = (Main(), 0); 12345678➜ before-main ./23MMMMMM1./2➜ before-main