- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Can a C++ variable be both const and volatile?
Yes a C++ variable be both const and volatile. It is used in situations like a read-only hardware register, or an output of another thread. Volatile means it may be changed by something external to the current thread and Const means that you do not write to it (in that program that is using the const declaration).
- Related Articles
- Variable defined with a reserved word const can be changed - JavaScript?
- How to modify a const variable in C?
- How to initialize const member variable in a C++ class?
- Difference between const int*, const int * const, and int const * in C/C++?
- Difference between const int*, const int * const, and int const * in C
- Difference between const char* p, char * const p, and const char * const p in C
- Can a class in Java be both final and abstract?
- Can we make Array volatile using volatile keyword in Java?
- Maximize big when both big and small can be exchanged in C++
- What are 'Volatile' and 'Non-volatile' substances?
- Why can't a Java class be both abstract and final?
- Difference between Volatile Memory and Non-Volatile Memory
- What is the difference between const int*, const int * const, and int const *?
- Can a local variable's memory be accessed outside its scope in C/C++?
- volatile keyword in C#

Advertisements