Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To correct this example, the size of buf can be directly added to buf and used as an upper bound. The integer literal is scaled appropriately and the upper bound of

Code Block
bgColor#CCCCFF
int buf[1024];
int *b = buf;

while (havedata() && b < buf+1024)
{
    *b++ = parseint(getdata());
}

...