[ create a new paste ] login | about

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

C, pasted on Oct 4:
1
2
3
4
5
6
7
8
9
10
#include <stdio.h>
int *getRef(void) {
  static int a = 1;
  return &a;
}
int main(void) {
  *getRef() = 2;
  printf("%d\n", *getRef());
  return 0;
}


Output:
1
2


Create a new paste based on this one


Comments: