[ create a new paste ] login | about

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

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

void func(){
  static int a = 200;
  int b = 1;


  printf("a=%d, b=%d /n", ++a, ++b);
  printf("a=%d, b=%d /n", a++, b++);
}

void main(){
  int i;
  for(i=1; i<=2; i++) func();
}


Output:
1
a=201, b=2 /na=201, b=2 /na=203, b=2 /na=203, b=2 /n


Create a new paste based on this one


Comments: