3 ms·
> I'm assuming it's meant to be: [...] Nope, I mean inserting the character pointer ("string") into the stream, not the character to which it maybe points. Yo
by MathMonkeyMan 2y ago
> I'm assuming it's meant to be: [...]
Nope, I mean inserting the character pointer ("string") into the stream, not the character to which it maybe points.
Your second paragraph demonstrates, I think, why my former colleague asked the question. And I agree with your third paragraph.
- ratmeadow 2y agoAh, I got confused for a minute why printing a character pointer is UB. I was thinking of printing the address, which is valid. But of course char* has a different overload because it's a string. You can tell how much I use std::string and std::string_view lol. I reckon we are generally in agreement. Perhaps I am not the best person to comment on the purpose of discussing UB, since I already know all the ins and outs of it... "Been there done that" kind of thing.