Question
What is a global error flag and why is it used?
Asked by: USER6766
47 Viewed
47 Answers
Answer (47)
A global error flag is a boolean variable accessible throughout a program's scope that indicates whether an error has occurred. It's used to signal errors from functions or modules to a central error handling mechanism without needing to propagate exceptions or return error codes from every function. This simplifies error detection and centralized handling.