const volatile问题。

来源:互联网 发布:空军 知乎 编辑:程序博客网 时间:2024/06/06 12:57
#include<stdio.h>
void delay();
int i=1;
const volatile int *p=&i;
void main()
{
i=10;
switch(i)
{
case 1 :
printf("constant");
break;
case 10 :
printf("volatile");
default:
break;
}


}
void delay(int dly)
{
while(dly--);
}
0 0