MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / main

Function main

base_code/volatile.cpp:4–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4int main() {
5// const int local = 10; // 10 10
6// volatile const int local = 10; // 10 100
7 const volatile int local = 10; // 10 100
8
9 int *ptr = (int*) &local;
10 printf("Initial value of local: %d \n", local);
11
12 *ptr = 100;
13 printf("Modified value of local: %d \n", local);
14 return 0;
15}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected