aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_static_variable.in
blob: 70b413243886910789c649d91d55745d10f31ee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>

struct DATA {
  int value;

  DATA() { value = 0; }
};

DATA& GetData() {
  static DATA data;

  return data;
}

int main() {
  GetData().value = 10;
  printf("value:%i", GetData().value);
}