Sams Teach Yourself C++ in 21 Days
In this appendix, you examine a linked list in detail as a case study of how you create complex structures and, more importantly ...
A Look at Linked Lists 877 E LISTINGE.1 Linked List 1: // *********************************************** 2: // FILE: Listing E. ...
49: else 50: return kIsSame; 51: } 52: 53: // forward declarations 54: class Node; 55: class HeadNode; 56: class TailNode; 57: c ...
A Look at Linked Lists 879 E 97: // it is passed to the node, which figures out 98: // where it goes and inserts it into the lis ...
148: // Head node has no data, it just points 149: // to the very beginning of the list 150: class HeadNode : public Node 151: { ...
A Look at Linked Lists 881 E 196: 197: // Delegate, delegate, delegate 198: void LinkedList::Insert(Data * pData) 199: { 200: my ...
For illustration purposes, the class Datais created on lines 30–39, and the Compare() method is implemented on lines 43–51. A Da ...
A Look at Linked Lists 883 E TailNode::Insertknows that the object it has been handed must be inserted immedi- ately before itse ...
After inserting the first node, program control resumes at line 214. Once again, the value is evaluated. For illustration purpos ...
A Look at Linked Lists 885 E The comparison is done again, and a new InternalNodeis created. This new InternalNodepoints to the ...
33 0672327112_app_e.qxd 11/19/04 12:30 PM Page 886 ...
* (indirection) operator, 226, 280 << (insertion) operator, 585-589 < (less than) operator, 28, 80 <= (less than or ...
adding increment operators, 303-304 adding to two lists (inheritance), 456 addition operator (+) overloading, 314-316 self-assig ...
assigning addresses to references, 259-260 values to variables, 50-52, 143 variables to user-defined classes, 320-321 assignment ...
methods accessor methods, 147-148 GetAge( ), 153 GetWeight( ), 164 implementing, 151-152 Meow( ), 148, 153 SetAge( ), 153 Cat ob ...
collaboration diagrams, 364 combining arrays, 446 math operators with assignment operators, 73-74 references and pointers, 280 c ...
declaring, 302-303 increment functions, 303-304 counting numbers, 183-184 variables, 195 cout object, 28-30, 598 example, 28-29 ...
references, 256-257, 262 static data members, 507, 689-692 string substitutions, 752 structures, 171 templates, 661-664 variable ...
double quote (“), 59 Double( ) function, 123 Doubler( ) function, 115 doubly linked lists, 875 DrawShape( ) function, 290-291 dy ...
function header files, 267-268 object files, 15 opening for input/output, 624-626 source files, 14 text files, 629-631 writing c ...
«
38
39
40
41
42
43
44
45
46
47
»
Free download pdf