It means that each element of z is read-only. In C++ they are the same. Is it possible for rockets to exist in a world that is only in the early stages of developing jet aircraft? Connect and share knowledge within a single location that is structured and easy to search. Consider the following example for instance: In the above example, we have explicitly changed the value of the breed of the dog object. You can get something close if you're willing to dynamically allocate the buffers. Have you ever seen Robert Downey Jr. in the same room as Djokovic? Consider, rev2023.6.2.43474. In the following program: void print() is a constant member function of the class const_check, so according to the definition of constants any attempt to change int a should result in an error, but the program works fine for me. In C++, a constant variable is a variable whose value cannot be changed once it has been assigned. Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet. //-->