From 7bab2c5e8d0301ca3480cbac92ecee99233f6677 Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Fri, 17 Apr 2015 22:51:02 +0800 Subject: Remove duplicate code. --- zh-cn/c++-cn.html.markdown | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'zh-cn/c++-cn.html.markdown') 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 { -- cgit v1.2.3