Skip to content

Commit 7dc7782

Browse files
committed
test07.cpp
1 parent bec64e1 commit 7dc7782

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

section2/test07.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
#include <iostream>
88

9+
void case1()
10+
{
11+
using namespace std;
12+
13+
//const int MAX_LEN = 1024;
14+
const volatile int MAX_LEN = 1024;
15+
const std::string NAME = "metroid";
16+
17+
auto ptr = (int*)(&MAX_LEN);
18+
*ptr = 2048;
19+
cout << MAX_LEN << endl;
20+
21+
}
22+
923

1024
constexpr
1125
int fib(int n)
@@ -21,6 +35,8 @@ int main()
2135
{
2236
using namespace std;
2337

38+
case1();
39+
2440
constexpr
2541
int fib5 = fib(5);
2642

0 commit comments

Comments
 (0)