home *** CD-ROM | disk | FTP | other *** search
- **********************************************************************
- * DISCLAIMER OF WARRANTIES: *
- * *
- * The following enclosed code is sample code created by IBM *
- * Corporation. This sample code is not part of any standard IBM *
- * product and is provided to you solely for the purpose of assisting *
- * you in the development of your applications. The code is provided *
- * "AS IS", without warranty of any kind. IBM shall not be liable *
- * for any damages arising out of your use of the sample code, even *
- * if they have been advised of the possibility of such damages *
- * *
- **********************************************************************
-
- SAMPLE - SumUp
-
- DESCRIPTION:
- This program uses a bag in which it stores integers. Then the
- program iterates over the bag in two different ways:
-
- o An Iterator Object is used to iterate over the bag to obtain
- the sum of the contained integers.
- o An Iterator Function is used to iterate over the bag to
- obtain the sum of the contained integers.
-
- If, for example you want to store and add the integers 1, 3, 4,
- 7, you invoke the program with the following command:
-
- sumup 1 3 4 7
-
- TASK:
- This program iterates over a collection in different ways.
-
- CONCEPT/FEATURE:
- This program is a sample to demonstrate the use of an iterator
- object and an iterator function.
-
- HOW TO RUN THE SAMPLE FROM THE COMMAND LINE:
- From within the directory containing the sample, simply type
- the name of the executable:
-
- SUMUP
-
- ADDITIONAL INFORMATION:
-
- For additional information on this and other samples shipped with
- the VisualAge for C++ product, see the Guide to Samples notebook.
-
- To access the notebook from Program Manager, open the VisualAge
- for C++ product object, then open the Guide to Samples notebook.
-
-