What is a global error flag and why is it used?

Responsive Ad Header

Question

Grade: Education Subject: Support
What is a global error flag and why is it used?
Asked by:
47 Viewed 47 Answers

Answer (47)

Best Answer
(359)
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.