摘要:
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
阅读(100)
评论(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
阅读(144)
评论(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
阅读(44)
评论(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
阅读(91)
评论(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
阅读(139)
评论(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
阅读(73)
评论(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
阅读(60)
评论(0)
推荐(0)

浙公网安备 33010602011771号