Friday, 29 March 2013

what Is Meaning of the Declaration Const Volatile Int a=6

value of variable cannot be changed by programmer (due to const) but it value can be changed by external device or hardware interrupt (due to volatile).



Example:

#include<stdio.h>
const volatile int a=6;// HERE variable int a is constant so that it can't change by the programmer but it   
                                                   can  change external because of volatile
int main()
{

  printf("canst volatile %d",a);

}


output: canst volatile 6

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More