Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not only do I understand that code, and agree it's reasonable C code, I suspect you made a mistake when copying the memmove line. I think it should be:

  memmove(nvtab.nameval+i, nvtab.nameval+i+1,
          (nvtab.nval-(i+1)) * sizeof(Nameval));
Experience C programmers will know memmove - it's been a long time since I even saw the signature, but I thought it was going to be source, destination and size. (Looked it up just now to be sure.) These "inline transformations" are common on addresses in C.

I personally like braces around for loops, but things like Nameval being the struct type for a nameval variable is common C practice.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: