Chapter 3: Problem 21
What is a global constant? Is it permissible to use global constants in a program?
Short Answer
Expert verified
Answer: A global constant is a constant value that can be used throughout the entire program, as it is declared outside any function or class. It is generally considered good practice to use global constants when done responsibly, as they can enhance code maintainability, readability, and prevent potential errors caused by hardcoding the same value in multiple places. However, it is important not to abuse global constants and to use meaningful names for them to avoid increased coupling between different parts of the code.