
828 Additional Information about ANSI and TURBO-C++
OUTPUT
k= 75
k= 85
Explanation: In the above program, the class XYZ is a one-integer mutable member. The
class also has value() and show() constant member functions. In the function main(), the
x is a constant object of class XYZ. When x is declared, the mutable member k is initial-
ized with 75. When the value() function is invoked, it is incremented with 10. The show()
function displays the values of the variables.
21.6 NAMESPACE SCOPE
C++ allows defining variables with a different scope such as local, global, blocks, classes, functions,
etc. This can be done using the keyword namespace introd ...