Ok I'm reading my C++ book I got in college, I'm on chapter 8, about 500 pages in. The book is talking about a program that calculates grades from 2 input files then outputs them back to a file. It uses
1 2 3
while (score != -999)
my question, what is the significance of -999 ? I know it must be the return of something, a error from something or whatever, i just can't remember what.
Probably just a "magic number" that escapes the loop.
The number itself has no significance other than that it's used to exit the loop. The program probably explicitly sets score to -999 somewhere when it wants the loop to stop.
It's unclear (hence your quesiton), which is why usage of magic numbers is not recommended.