mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-04-03 10:40:24 +08:00
update
This commit is contained in:
15
basic_content/volatile/noopt_vola.cpp
Normal file
15
basic_content/volatile/noopt_vola.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/* Compile code without optimization option */
|
||||
#include <stdio.h>
|
||||
int main(void)
|
||||
{
|
||||
const int local = 10;
|
||||
int *ptr = (int*) &local;
|
||||
|
||||
printf("Initial value of local : %d \n", local);
|
||||
|
||||
*ptr = 100;
|
||||
|
||||
printf("Modified value of local: %d \n", local);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user