How does this K&R code for reading an int work?
I'm having trouble understanding the code for getting an int in K&R. Specifically the last line of this function:
void getint( int *pn )
{
int c;
while (isspace(c = getch()))
;
for (*pn = 0; isdigit(c); c = getch())
*pn = 10 * *pn + (c - '0') ;
}