我刚刚开始学习C++ - 我在Windows上使用nuwen的MingW版本,使用NetBeans作为IDE(我也有MSDN AA版本的MSVC 2008,尽管我不经常使用它).
编译这个简单的程序时:
#include <iostream>
using namespace std;
int dog, cat, bird, fish;
void f(int pet) {
cout << "pet id number: " << pet << endl;
}
int main() {
int i, j, k;
cout << "f(): " << (long)&f << endl;
cout << "dog: " << (long)&dog << endl;
cout << "cat: " << (long)&cat << endl;
cout << "bird: " << (long)&bird << endl;
cout << "fish: " << (long)&fish << endl; …Run Code Online (Sandbox Code Playgroud)