Discuss Passing by reference/pointer for efficiency

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,153
78,998
2,396
Passing by reference eliminates the re-creation of structures in the scope of the called function. When do you recommend doing this to be efficient? Do you guys have a "limit" like, if the structure is over 32 bytes pass by reference, otherwise just pass by value? Cuz that's kinda what I've been doing, just curious what you guys do
 

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
If the "structure" is bigger than 4 bytes which is the size of a pointer I pass it by reference/pointer ^^
 

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
depense realy much for me, since if i need to pass e.g. a layout to an object, then i can do it with a ptr if its wished that the modifications of the layout will be applied in the object, if not i let it be copied, then i can modify the layout for other things/objects without actively create a new layout etc

And I dont like reference, because if you use a ptr you will see it, if you use a reference it looks like a normal var which can lead to mistakes in big projects
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods