摘要:
Pizza.h 1 #ifndef _PIZZA_H 2 #define _PIZZA_H 3 #include 4 #include 5 6 class Pizza 7 { 8 public: 9 Pizza(const std::string &type) : m_type(typ... 阅读全文
摘要:
很有用,收藏http://blog.csdn.net/skykingf/article/details/45267517 阅读全文
摘要:
Beverage.h 1 #ifndef BEVERAGE_H_INCLUDED 2 #define BEVERAGE_H_INCLUDED 3 4 #include 5 6 class Beverage 7 { 8 public: 9 Beverage( std::string de... 阅读全文
摘要:
WeatherData.h 1 #ifndef WEATHERDATA_H_INCLUDED 2 #define WEATHERDATA_H_INCLUDED 3 4 #include 5 #include "Display.h" 6 7 class WeatherData 8 { 9 pub... 阅读全文
摘要:
前言最近在学习《Headfirst设计模式》,里面的例子都是Java的。但是我对Java并不熟悉,所以试着用C++来实现书中的例子。先来看看Duck以及子类Duck.h 1 #include 2 #include "FlyBehavior.h" 3 4 class Duck 5 { 6 priv... 阅读全文