Order of const and volatile for a variable
问题 The following piece of code compiles and runs with gcc version 4.7.2 (Debian 4.7.2-5) : #include <stdio.h> int main() { const volatile x = 3; volatile const y = 4; return 0; } Should I assume that the order of const and volatile is irrelevant? I tried reading up here : encpp ref and it doesn't say anything about the order(or I'm missing it?) 回答1: Yes, the order is irrelevant. In C++, the relevant specification is in 7.1p1, decl-specifier and decl-specifier-seq , which basically explain that