Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


What is a pointer in human language ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Ax3l
Cheater
Reputation: 1

Joined: 22 May 2011
Posts: 37

PostPosted: Fri Jun 17, 2011 5:08 pm    Post subject: What is a pointer in human language ? Reply with quote

I don't really get what a pointer actually is good for except memory hacking shit

can someone explain in non-microsoftish|wikipedish language ?
Back to top
View user's profile Send private message MSN Messenger
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Fri Jun 17, 2011 5:14 pm    Post subject: Reply with quote

I'll give you the Java perspective of references (may be different for other languages)

Whenever you create an object, you often don't know how much space you'll need for that object. For instance, you could create a String that is 10 char's long or 100 char's long, and those have different space requirements.

So when you instantiate the object, it is a given is given a null pointer (it hasn't been created yet). Whenever you assign a value/new object to it, the memory is allocated and the pointer to that memory is assigned to the object in your program. So even though the memory is now in a different space, you can still just refer to the variable as you were, because the pointer's location is the same.

Does that make sense?

ps. you don't need pointers for primitives because they have a predetermined size that the compiler knows, so you can allocate upfront memory.

_________________
Back to top
View user's profile Send private message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Fri Jun 17, 2011 6:16 pm    Post subject: Reply with quote

They're just datatypes used to contain an address/handle to something else.
_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Fri Jun 17, 2011 7:41 pm    Post subject: Reply with quote

Pointers are useful in cases where you would rather pass around a single address instead of a lot of data, while still being able to access it all by reference.

I highly suggest that you learn Java (if you haven't already) if for nothing more than to learn how important pointers are for OOP.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Fri Jun 17, 2011 9:17 pm    Post subject: Reply with quote

Here's a fairly easy to follow explanation:
http://www.cplusplus.com/doc/tutorial/pointers/

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites