Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
This is the answer of exercise #5: The many types of const.
The five types of const are:
The five types of const prevent the following from modification:
Below are examples of each type of const.
This applies to both local and global variables.
int main() |
void Cout(const std::string& anyString) |
struct Values |
Nearly all 'getters' are const member functions.
struct MyClass |
struct Person |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.