Page 317 - DCAP404 _Object Oriented Programming
P. 317

Object-oriented Programming




                    Notes
                                                                    Figure  14.1







































                                   A closely related technique is that of inserting several unique printf statements, such as

                                   Printf(“debugging - line 1/n”);
                                   Printf(“Debugging - line 2/n”);
                                   etc. at various places within the program. When the program is executed, the debug messages
                                   will indicate the approximate location of the error.





                                     Notes  The source of the error will lie somewhere between the last printf statement whose
                                     message did appear, and the first printf statement whose message did not appear.

                                   Watch Values

                                   A watch value is the value of a variable or an expression which is displayed continuously as the
                                   program executes. Thus, you can see the  changes in a watch value as they occur, in response to
                                   the program logic. By monitoring a few carefully selected watch values, you can often determine
                                   where the program begins to generate incorrect or unexpected values.
                                   Breakpoints


                                   A breakpoint is a temporary stopping point within a program. Each breakpoint is associated
                                   with a particular instruction within the program. When the program is executed, the program



          310                               LOVELY PROFESSIONAL UNIVERSITY
   312   313   314   315   316   317   318   319   320   321   322