From the course: C++ Essential Training
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
Qualifiers - C++ Tutorial
From the course: C++ Essential Training
Qualifiers
- Qualifiers are used to adjust qualities of an object or a variable. This is an example of a variable declaration with qualifiers. In this example, the const and static keywords are the qualifiers. They tell the computer that this variable will be immutable. That's the const qualifier, and that it will have static storage duration. There are two types of qualifiers in C++, CV qualifiers and storage duration qualifiers. CV stands for constant and volatile. Const marks a variable as read only or immutable. It's value cannot be changed once it's been defined. Mutable is used on data members to make them writeable from a const qualified member function. I covered this in the companion course C++: Advanced Topics. Volatile marks a variable that may be changed by another process. This is rarely used and it's partly deprecated in C++ 20. It may be useful for external variables under very specific circumstances.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Overview of data types3m 21s
-
(Locked)
Integer types2m 43s
-
(Locked)
Floating point types6m 51s
-
(Locked)
The auto type4m 2s
-
(Locked)
Qualifiers4m 33s
-
(Locked)
Type aliases2m 5s
-
(Locked)
Primitive arrays5m 23s
-
(Locked)
C-strings4m 37s
-
(Locked)
Structures2m 50s
-
(Locked)
Challenge: Library card2m 9s
-
(Locked)
Solution: Library card1m 16s
-
-
-
-
-
-
-