2 ms·
> You can't add a number to a string Haven't written JavaScript?
by erikerikson 2y ago
> You can't add a number to a string
Haven't written JavaScript?
- MrMcCall 2y agoI don't care if it "can" be done, the results will be garbage unless you are very, very careful. And Javascript is garbage no matter how many people use it successfully, as I have done professionally.
- SAI_Peregrinus 2y agoOr C. It just turns into pointer math. Godbolt example here[1], just make sure the `int` is an offset within the bounds of the char* and it's well-defined. [1] https://godbolt.org/z/YWKK1P7zj https://godbolt.org/z/YWKK1P7zj