cm0002@lemmy.world to Programmer Humor@programming.dev · 3 days agoDoes this exist anywhere outside of C++?lemmy.mlexternal-linkmessage-square49fedilinkarrow-up1162cross-posted to: programmerhumor@lemmy.ml
arrow-up1162external-linkDoes this exist anywhere outside of C++?lemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 3 days agomessage-square49fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareuranibaba@lemmy.worldlinkfedilinkarrow-up2·3 days agoI haven’t looked at the code but I always assumed that println was a call to print with a new line added to the original input. Something like this: void print(String text) { ... } void println(String text) { this.print(text + '\n'); }
minus-squareScoopta@programming.devlinkfedilinkarrow-up2·2 days agoThat is pretty much what it does except it doesn’t hardcode \n but instead uses the proper line ending for the platform it’s running on.
I haven’t looked at the code but I always assumed that
println
was a call toprint
with a new line added to the original input.Something like this:
That is pretty much what it does except it doesn’t hardcode
\n
but instead uses the proper line ending for the platform it’s running on.