home *** CD-ROM | disk | FTP | other *** search
- /*
- * Example 8: FileManager. Retrives the linked list of ints saved by Example 7.
- * This example appears in Section 11.2 of the manual.
- *
- * $Header: E:/vcs/toolexam/example8.cpv 1.1 01 Apr 1992 16:51:12 keffer $
- *
- ****************************************************************************
- *
- * Rogue Wave Software, Inc.
- * P.O. Box 2328
- * Corvallis, OR 97339
- * Voice: (503) 754-2311 FAX: (503) 757-7350
- *
- * Copyright (C) 1989, 1990, 1991. This software is subject to copyright
- * protection under the laws of the United States and other countries.
- *
- ***************************************************************************
- *
- * $Log: E:/vcs/toolexam/example8.cpv $
- *
- * Rev 1.1 01 Apr 1992 16:51:12 keffer
- * Now includes <rw/xxx.h>
- *
- */
-
- #include <rw/filemgr.h>
- #include <rw/rstream.h>
-
- struct DiskNode {
- int data;
- RWoffset nextNode;
- };
-
- main()
- {
- RWFileManager fm("linklist.dat");
-
- fm.SeekTo(fm.start());
- RWoffset next;
- fm.Read(next);
-
- DiskNode n;
- while (next != NIL) {
- fm.SeekTo(next);
- fm.Read(n.data);
- fm.Read(n.nextNode);
- cout << n.data << "\n";
- next = n.nextNode;
- }
- return 0;
- }
-
-