Hi All,
i want to know what is the use of const volatile variable, where exactly it is required to use.
Abhishek_jn
0
Newbie Poster
Recommended Answers
Jump to Post
const
means the program can not modify the valuevolatile
means the value may be arbitrarily modified outside the program.the two are separate and not mutually exclusive.
use them together, for instance, in the case of reading a hardware status register.
const
prevents the value from …
Jump to PostHi All,
i want to know what is the use of const volatile variable, where exactly it is required to use.Let's take an example
const volatile usigned int *REG_A = (usigned int *) init_hardware_n_return_address of REG_A();
In the above snippet function "init_hardware_n_return_address of REG_A()" modifies the content …
Jump to Posti get no love :(
All 9 Replies
MosaicFuneral
812
Nearly a Posting Virtuoso
Abhishek_jn
0
Newbie Poster
jephthah
1,888
Posting Maven
Dave Sinkula
commented:
I sometimes like to add something like, "interpret 'const' as 'read-only'." But you've got all bases covered here already.
+18
gkishore
18
Newbie Poster
Dave Sinkula
commented:
This, and the post prior, do well to explain CV with good examples.
+18
Abhishek_jn
0
Newbie Poster
jephthah
1,888
Posting Maven
William Hemsworth
commented:
Awwh *hug*
+8
Abhishek_jn
0
Newbie Poster
Saikrishna_bhi
0
Newbie Poster
nbaztec
45
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.