cross-posted from: https://lemmy.ml/post/14869314

“I want to live forever in AI”

You are viewing a single thread.
View all comments
13 points

Whats the difference between void fn(Type& var) and void fn(Type* var)?

permalink
report
reply
29 points

Sends original data vs making a copy of data and sending it.

In meme context you’d be just making a copy of your consciousness and putting it in a machine. Whatever reason you’re doing it for - escape illness, survive armageddon, nothing changes for you. A copy of you lives on though.

permalink
report
parent
reply
10 points

It’s not like the post, secont is a pointer.

permalink
report
parent
reply
8 points

I mean, just kill the host as soon as the upload is complete. at best you are not conscious during the process and when “you” wake up you are in the cloud. The version of you that awakes gets told that the “transfer” was complete.

permalink
report
parent
reply
12 points

Upload is a fun show

permalink
report
parent
reply
8 points

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*.

permalink
report
parent
reply
7 points

You can pass nullptr in the second example (that is not what OP wrote though, hes second is making a copy).

permalink
report
parent
reply
3 points

Thanks, I was Just curious. I knew what * did but I wasn’t sure about &

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7.5K

    Monthly active users

  • 978

    Posts

  • 38K

    Comments