roon ( roon@lemmy.ml ) to Programmer Humor@programming.devEnglish · 3 years ago"I want to live forever in AI"lemmy.mlimagemessage-square64linkfedilinkarrow-up1430file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1430image"I want to live forever in AI"lemmy.mlroon ( roon@lemmy.ml ) to Programmer Humor@programming.devEnglish · 3 years agomessage-square64linkfedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squarepewpew ( pewpew@feddit.it ) linkfedilinkarrow-up9·3 years agoWhats the difference between void fn(Type& var) and void fn(Type* var)?
minus-squarecbazero ( cbazero@programming.dev ) linkfedilinkarrow-up8·3 years agoI guess you ask for C++. There Type* can be null while Type& can’t be null. When it gets compiled Type& is compiled (mostly) to the same machinecode as Type*.
Whats the difference between
void fn(Type& var)andvoid fn(Type* var)?I guess you ask for C++. There Type* can be null while Type& can’t be null. When it gets compiled Type& is compiled (mostly) to the same machinecode as Type*.