这是thinking in java第二版的书上原码.

源代码在线查看: private.cpp

软件大小: 223 K
上传用户: danlong
关键词: thinking java in
下载地址: 免注册下载 普通下载 VIP

相关代码

				//: C05:Private.cpp
				// From Thinking in C++, 2nd Edition
				// Available at http://www.BruceEckel.com
				// (c) Bruce Eckel 2000
				// 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
				} ///:~
							

相关资源