Thinking in C++ 2.0书籍源码光盘

源代码在线查看: private.cpp

软件大小: 400 K
上传用户: ldh_ncu10
关键词: Thinking 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
				} ///:~
							

相关资源