yourpets2.cpp

来自「Think in C++ 2nd」· C++ 代码 · 共 26 行

CPP
26
字号
//: C03:YourPets2.cpp

// From Thinking in C++, 2nd Edition

// Available at http://www.BruceEckel.com

// (c) Bruce Eckel 1999

// Copyright notice in Copyright.txt

#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;

  cout << "i: " << (long)&i << endl;

  cout << "j: " << (long)&j << endl;

  cout << "k: " << (long)&k << endl;

} ///:~

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?