[ create a new paste ] login | about

Link: http://codepad.org/vO5J8vzi    [ raw code | output | fork ]

appunti2 - C, pasted on May 2:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>

double *f (void)
{
  double x = 1234.5678;
  return &x;                  // Orrore!
}

int main (int argc, char *argv[])
{
  double *p;
  p = f ();
  printf ("x = %f\n", *p);
  return 0;
}


Output:
1
x = 2.189515


Create a new paste based on this one


Comments: