...
Code Block | ||
---|---|---|
| ||
int buf[INTBUFSIZE]; int *buf_ptr = buf; while (havedata() && buf_ptr < (buf + INTBUFSIZE)) { *buf_ptr++ = parseint(getdata()); } |
A An arguably better solution maybe is to use the address of the non-existent element following the end of the array as follows:
...