摘要:
You might start your Rational class this way: class Rational { public: Rational(int numerator = 0, // ctor is deliberately not explicit; int denominat 阅读全文
posted @ 2021-09-07 18:25
MyCPlusPlus
阅读(96)
评论(0)
推荐(0)
摘要:
Imagine a class for representing web browsers. Among the many functions such a class might offer are those to clear the cache of downloaded elements, 阅读全文
posted @ 2021-09-07 17:33
MyCPlusPlus
阅读(137)
评论(0)
推荐(0)
摘要:
If everything in the public interface is a function, clients won't have to scratch their heads trying to remember whether to use parentheses when they 阅读全文
posted @ 2021-09-07 17:02
MyCPlusPlus
阅读(39)
评论(0)
推荐(0)
摘要:
Consider a class for representing rational numbers, including a function for multiplying two rationals together: class Rational { public: Rational(int 阅读全文
posted @ 2021-09-07 16:35
MyCPlusPlus
阅读(90)
评论(0)
推荐(0)
摘要:
By default, C++ passes objects to and from functions by value (a characteristic it inherits from C).The end result is that passing an object by value 阅读全文
posted @ 2021-09-07 15:42
MyCPlusPlus
阅读(133)
评论(0)
推荐(0)
摘要:
How do you design effective classes? First, you must understand the issues you face. Virtually every class requires that you confront the following qu 阅读全文
posted @ 2021-09-07 11:18
MyCPlusPlus
阅读(71)
评论(0)
推荐(0)
摘要:
Developing interfaces that are easy to use correctly and hard to use incorrectly requires that you consider the kinds of mistakes that clients might m 阅读全文
posted @ 2021-09-07 10:50
MyCPlusPlus
阅读(55)
评论(0)
推荐(0)

浙公网安备 33010602011771号