News for hackers. Stuff that matters.
Re:Re: C as used/implemented in practice by to3m on Monday July 13, 2015 @08:12PM (#9882040)
I switched over to using size_t for array indexes a few years ago, and found this a big improvement. And once I switched to size_t, most of my uses of unsigned went away - either you care about the size (and you want a uintN_t), or you don't (and you probably want size_t).
Re:Re: C as used/implemented in practice by lsiebert on Tuesday July 14, 2015 @01:55AM (#9883115)
I think this works best if you pass a pointer to an error structure in the parameters. I've found people often use signed integer types with arrays so they can return a -1 to signal that something went wrong.