home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbo_c / tbug.arc / DEMO.C next >
Text File  |  1987-09-15  |  1KB  |  50 lines

  1. /*
  2.                    TURBO C DEBUG DEMO PROGRAM
  3.                    by: Gary L. Mellor    1987
  4. */
  5. #include <dos.h>
  6. /*                 THESE ARE THE GLOBAL VARIABLES
  7.                    FOR THE DEMO PROGRAM
  8. */
  9. int gint;
  10. int *gptr;
  11. char gchar;
  12. float gfloat;
  13. char gtemp[80];
  14. /*
  15.                    MAIN DEMO
  16. */
  17. int main()
  18. {
  19.   int i;
  20.  
  21.   puts("THIS IS THE TBUG DEMO PROGRAM\n");
  22.   puts("When you are at the debug prompt 'TBUG?' type 'HELP'");
  23.   puts("to get a listing of the tbug commands\n");
  24.   puts("Feel free to use the 'BREAK' command to set a");
  25.   puts("breakpoint at a line number and to execute");
  26.   puts("the main program, and try the other commands\n");
  27.   puts("HAVE FUN!!!\n");
  28.  
  29.   debug_init("DEMO");
  30.  
  31.   printf("\n PLEASE ENTER A VALUE FOR global1 ");
  32.   gets(gtemp);
  33.   gptr = &gint;
  34.   gint = atoi(gtemp);
  35.   gchar = gtemp[1];
  36.   gfloat = strlen(gtemp) + 1;
  37.   gint++;
  38.   gfloat =  gfloat / 3;
  39.   for (i = 0; i < 3; i++)
  40.     sub1(gint++);
  41.   puts("MAIN RETURNING");
  42.   return(0);
  43. }
  44. int sub1(x)
  45. int x;
  46. {
  47.   printf("SUB1 PARAMETER = %d\n",x);
  48.   return(x);
  49. }
  50.