New answers tagged

0 votes

A small header-only input output library

Is there any good reason that we don't set IO_IMPLEMENTATION whenever IO_STATIC is defined? It doesn't make sense to have ...
Toby Speight's user avatar
  • 74.5k
4 votes

A small header-only input output library

There is a lot to review here. Power-of-2 read size in io_read_line() Since it looks like code is trying to use a power-of-2 ...
chux - Reinstate Monica's user avatar
5 votes
Accepted

Read a line from a stream

A real good get line function is tricky and sadly missing in standard C. Are there any bugs in the code? See below. Are there any edge cases I have missed? See below. Does the function provide ...
chux - Reinstate Monica's user avatar
2 votes

Error handling with C-string input using get() and getline()

Writing all the code in a single huge main() is not only hard to read, but also a poor use of your skills. Write a re-usable function to prompt and read input from ...
Toby Speight's user avatar
  • 74.5k

Top 50 recent answers are included