In find.c, there's a conditional that references a constant called "INT_MAX". I looked through all the pset files and couldn't find any reference to this constant. What is it, what does it represent, and where is it defined?
INT_MAX is defined in limits.h, which is a standard C header.
INT_MAX: Maximum value for an object of type int (32767 or greater)
You may wonder why
find.c needs that?
int straw = GetInt(); if (straw = INT_MAX)
If you look at cs50.c (which defines
GetInt()), you'll see that
GetInt() returns INT_MAX when it doesn't receive an integer:
// get line of text, returning INT_MAX on failure string line = GetString(); if (line == NULL) return INT_MAX;
find.c uses INT_MAX to recognize that GetInt() received a NULL line (ie, the user ended the entry).