#include <iostream>
#include <stdlib.h>
using namespace std;
class A {
public:
A() {
cout < < "I come here before main()! " < < endl;
f();
}
static void f() {
cout < < "I come here before main() too! " < < endl;
}
};
static A a;
int main(int argc, char *argv[])
{
cout < < "Entering main()! " < < endl;
cout < < "Leaving main()! " < < endl;
system( "PAUSE ");
return 0;
}
http://topic.youkuaiyun.com/t/20030103/17/1324264.html这里面已经有各位高手讨论了