Comment by ziml77
5 years ago
I don't understand why it would need to use strlen anyway. Why wouldn't it treat the string like a stream when scanf is already coded to operate on an actual stream?
5 years ago
I don't understand why it would need to use strlen anyway. Why wouldn't it treat the string like a stream when scanf is already coded to operate on an actual stream?
It's an implementation strategy, one of at least two, explained at https://news.ycombinator.com/item?id=26298300 on this very page.