thingking in c++(C++编程思想) 各章节课后练习的答案

源代码在线查看: public.cpp

软件大小: 243 K
上传用户: ludingpc
关键词: thingking in 编程
下载地址: 免注册下载 普通下载 VIP

相关代码

				//: C05:Public.cpp
				// From Thinking in C++, 2nd Edition
				// Available at http://www.BruceEckel.com
				// (c) Bruce Eckel 2000
				// Copyright notice in Copyright.txt
				// Public is just like C's struct
				
				struct A {
				  int i;
				  char j;
				  float f;
				  void func();
				};
				
				void A::func() {}
				
				struct B {
				public:
				  int i;
				  char j;
				  float f;
				  void func();
				};
				
				void B::func() {}  
				
				int main() {
				  A a; B b;
				  a.i = b.i = 1;
				  a.j = b.j = 'c';
				  a.f = b.f = 3.14159;
				  a.func();
				  b.func();
				} ///:~
							

相关资源