logoalt Hacker News

kevin_thibedeautoday at 8:32 PM1 replyview on HN

idx should be a size_t.


Replies

einpoklumtoday at 9:36 PM

Actually, there are historical reasons why `int` may be used. Look at the definition of the %n format specifier - it expects an `int *` argument. And all of the famirly functions return `int`'s ... see also:

https://stackoverflow.com/q/45740276/1593077