How does this K&R code for reading an int work?
13:42 31 May 2016

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') ;
}
c