home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH16 / F161823.FLD < prev    next >
Encoding:
Text File  |  1993-08-13  |  2.0 KB  |  1 lines

  1. ╦char access╦( unsigned int index╦) {         ╘// Part 3                                      char array╦[] = {'a'╦, 'b'╦, 'c'╦};                                                    if ( index ╦>= 3╦) { throw( BoundsExcept╦()); }                                           return  array╦[index╦];                                                                   }                                                                                                  void main╦() {                                                                                     for (int i ╦= 1╦; i ╦<= 3 ╦; i╦++) {                                                   try {                                                                                                 if ( i╦ == 1╦ )                                                                                 divide╦(1╦,0╦);╘      // attempt to divide 1 by 0                                     ╦else if (i╦ == 2╦)                                                                            read╦(); ╘              // always throws an IOExcept                                        ╦else if (i ╦== 3╦)                                                                            access╦();╘     // always throws an Exception                                            ╦}