In C++, the string data type provides the necessary abstraction to allow C++ programmers to work with character strings. The Java counterpart is actually two separate classes.
Unlike its Java counterparts, the C++ string type is not available to all programs by default. If a C++ program requires the string type, the programmer must refer to the library that defines this type. The following listing illustrates the C++ string data type in action.
1: 2: 3: | const int BOILING_POINT = 100;const int FREEZING_POINT = 0;const float PI = 3.14159; |
Listing 2 Constant variables |