Think in C++ 2nd

源代码在线查看: private.cpp

软件大小: 4587 K
上传用户: huajunun
关键词: Think 2nd in
下载地址: 免注册下载 普通下载 VIP

相关代码

				//: C05:Private.cpp

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

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

				// (c) Bruce Eckel 1999

				// Copyright notice in Copyright.txt

				// Setting the boundary

				

				struct B {

				private:

				  char j;

				  float f;

				public:

				  int i;

				  void func();

				};

				

				void B::func() {

				  i = 0;

				  j = '0';

				  f = 0.0;

				};

				

				int main() {

				  B b;

				  b.i = 1;    // OK, public

				//!  b.j = '1';  // Illegal, private

				//!  b.f = 1.0;  // Illegal, private

				} ///:~

							

相关资源