Sams Teach Yourself C++ in 21 Days
often four bytes on a machine with a 32-bit processor. By using bit fields, you can store eight binary values in a charand 32 su ...
What’s Next 777 21 33: return FullTime; 34: else 35: return PartTime; 36: } 37: 38: void student::SetStatus(STATUS theStatus) 39 ...
studentis declared on lines 9–28. Although this is a trivial class, it is interesting because all the data is packed into five b ...
What’s Next 779 21 Programming Style ........................................................................................... ...
Long Lines and Function Length .................................................................. Keep lines to the width displa ...
What’s Next 781 21 Use whitespace to help readability. Don’t use spaces between object and array names and their operators (.,- ...
The length of a variable’s name should be proportional to its scope. Be certain identifiers look and sound different from one a ...
What’s Next 783 21 Higher-level comments are infinitely more important than process details. Add value; do not merely restate t ...
includeFiles .................................................................................................. Try as hard as y ...
What’s Next 785 21 Where to Get Help and Advice ...................................................................... The very ...
Staying in Touch ............................................................................................ If you have commen ...
What’s Next 787 21 Q&A ..................................................................................................... ...
it is a difficult transition to give it up. New styles look wrong and create confusion. If you get bored, try logging in to a po ...
What’s Next 789 21 Exercises ................................................................................................... ...
...
In Review The following program (as shown in Listing R3.1) brings together many of the advanced techniques you’ve learned during ...
792 Week 3 LISTINGR3.1 Week 3 in Review Listing 0: // ************************************************** 1: // 2: // Title: Week ...
In Review 793 43: // **************** Part ************ 44: // Abstract base class of parts 45: class Part 46: { 47: public: 48: ...
794 Week 3 89: itsModelYear(year), 90: Part(partNumber) 91: {} 92: 93: void CarPart::Display() const 94: { 95: Part::Display(); ...
In Review 795 134: friend class List<T>; 135: Node (T*); 136: ~Node(); 137: void SetNext(Node * node) { itsNext = node; } ...
«
36
37
38
39
40
41
42
43
44
45
»
Free download pdf