4 ms·
> Not true, just tried it in MSVC and it compiled fine but with a warning on conflicting types. If I meant that it would cause the compiler to report an error
by anonymoushn 3y ago
> Not true, just tried it in MSVC and it compiled fine but with a warning on conflicting types.
If I meant that it would cause the compiler to report an error then I would have written that.
> If that's the case, then it should have been something along the lines of *"HTTP" instead.
We can say that they really should have written memcpy to get the string literal into the size_t or we can accept that sometimes people use language imprecisely and expect readers to make an effort to understand rather than make an effort not to understand.
- PaulCarrack 3y ago> or we can accept that sometimes people use language imprecisely and expect readers to make an effort to understand rather than make an effort not to understand. I don't disagree with you there, however, things like pointers and string literals (and what they actually represent) in my experience are a source of confusion to junior systems engineers. I'd imagine that the intended reader is someone who wants to be a systems engineer, not someone who is already a systems engineer. I expect the reader to be motivated to understand (after all, they are reading the article) but not understand and get confused because of the imprecise language, especially in the case in programming where precision matters (or the code doesn't work).