Sams Teach Yourself C++ in 21 Days
796 Week 3 176: } 177: 178: // **************** List ************ 179: // Generic list template 180: // Works with any numbered ...
In Review 797 217: else 218: throw EmptyList(); 219: } 220: 221: template <class T> 222: T * List<T>::operator[](int ...
798 Week 3 261: Node<T> * pCurrent = pHead; 262: Node<T> * pNext = 0; 263: 264: int New = pObject->GetObjectNumbe ...
In Review 799 309: List<Part> theList; 310: int choice = 99; 311: int ObjectNumber; 312: int value; 313: Part * pPart; 314 ...
800 Week 3 347: catch (OutOfMemory) 348: { 349: cout << “Not enough memory; Exiting...” << endl; 350: return 1; 351: ...
In Review 801 379: catch (EmptyList) 380: { 381: cout << “The list is empty!” << endl; 382: return 1; 383: } 384: ca ...
802 Week 3 exceptions; they serve as flags to the catchstatements, which print out a very simple warning and then exit. A more r ...
In Review 803 On lines 307 and 308, the driver program creates a list of two types of Partobjects and then prints out the values ...
804 Week 3 20: }; 21: 22: void DoIt(Cat*); 23: void DoIt(Dog*); 24: 25: int main() 26: { 27: Animal * pA = new Dog; 28: DoIt(pA) ...
In Review 805 17: { 18: public: 19: void Speak() { cout << “Cat Speaks” << endl; } 20: }; 21: 22: void DoIt(Animal*) ...
28 0672327112_w3_wir.qxd 11/19/04 12:30 PM Page 806 ...
APPENDIX A Working with Numbers: Binary and Hexadecimal You learned the fundamentals of arithmetic so long ago, it is hard to im ...
In base 10 (decimal) math, you use ten symbols—the numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9—to represent all numbers. How is th ...
Working with Numbers: Binary and Hexadecimal 809 A That is, eight asterisks and seven. That would be represented in base 8 as 17 ...
In this example, the 4 in the third column represents the decimal value 196, and the 4 in the first column represents the value ...
Working with Numbers: Binary and Hexadecimal 811 A There is one 64 in 88, so column 7 is 1 and 24 is the remainder. There are no ...
Bits, Bytes, and Nybbles ................................................................................ After the decision is ...
Working with Numbers: Binary and Hexadecimal 813 A Hexadecimal ................................................................. ...
1*16 = 16. 28-16 = 12 1*8 = 8. 12-8 = 4 1*4 = 4. 4-4 = 0 0*2 = 0 0*1 = 0 124+60+28+12+4 = 252. Thus, the answer in binary is 111 ...
Working with Numbers: Binary and Hexadecimal 815 A 1 × 11 1 × 22 1 × 44 0 × 80 1 × 16 16 0 × 32 0 1 × 64 64 1 × 128 128 1 × 256 ...
«
37
38
39
40
41
42
43
44
45
46
»
Free download pdf