top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Can a variable be both constant and volatile? [CLOSED]

+4 votes
63 views
Can a variable be both constant and volatile? [CLOSED]
This question has an answer at: What is use of const volatile ?
posted Nov 17, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

Answering again here

Answer is Yes. The const modifier means that this code cannot change the value of the variable, volatile still means that compiler cannot optimize or reorder. Both can appear in any order i.e. constant volatile or volatile constant.

answer Nov 17, 2013 by Salil Agrawal
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...