summaryrefslogtreecommitdiffhomepage
path: root/zh-cn/c++-cn.html.markdown
diff options
context:
space:
mode:
authorArnie97 <arnie97@gmail.com>2015-04-17 22:51:02 +0800
committerArnie97 <arnie97@gmail.com>2015-04-17 22:51:02 +0800
commit7bab2c5e8d0301ca3480cbac92ecee99233f6677 (patch)
treeabcd32447abdd5a4d37d454e4d38726954d6566e /zh-cn/c++-cn.html.markdown
parentc5212932b9e7fb2d42eb74049877488678b85967 (diff)
Remove duplicate code.
Diffstat (limited to 'zh-cn/c++-cn.html.markdown')
-rw-r--r--zh-cn/c++-cn.html.markdown18
1 files changed, 0 insertions, 18 deletions
diff --git a/zh-cn/c++-cn.html.markdown b/zh-cn/c++-cn.html.markdown
index e5c5d5df..e1551e2b 100644
--- a/zh-cn/c++-cn.html.markdown
+++ b/zh-cn/c++-cn.html.markdown
@@ -289,8 +289,6 @@ public:
}; // 在类的定义之后,要加一个分号
-}; // 记住,在类的定义之后,要加一个分号!
-
// 类的成员函数通常在.cpp文件中实现。
void Dog::Dog()
{
@@ -309,22 +307,6 @@ void Dog::setWeight(int dogsWeight)
weight = dogsWeight;
}
-// 虚函数的virtual关键字只需要在声明时使用,不需要在定义时出现
-void Dog::print() const
-{
- std::cout << "Dog is " << name << " and weighs " << weight << "kg\n";
-}
-
-void Dog::~Dog()
-{
- cout << "Goodbye " << name << "\n";
-}
-
-void Dog::setWeight(int dogsWeight)
-{
- weight = dogsWeight;
-}
-
// 虚函数的virtual关键字只需要在声明时使用,不需要在定义时重复
void Dog::print() const
{