home *** CD-ROM | disk | FTP | other *** search
- /* Program mdb_bad.c */
-
- #include <stdio.h>
- #include <math.h>
-
- double foo(int *bar) { /* Takes an int pointer, */
- /* returns a double. */
- double x;
-
- x = (double) *bar--; /* Dereference pointer, */
- /* postdecrement value. */
-
- return pow(2.0, x); /* Return 2 to the x power. */
- }
-
- void main(void) {
- int i = 10; /* Initialize seed value. */
- double foo(int *bar);
-
- while(i) /* While i is not 0, */
- printf("%lf\n", foo(&i)); /* print foo of i. */
-
- return;
- }
-
-