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 


not sure..

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

Joined: 03 Jun 2007
Posts: 65

PostPosted: Thu Apr 02, 2009 12:33 pm    Post subject: not sure.. Reply with quote

heey guys i was reading some posts about pointers in c
and found this: http://forum.cheatengine.org/viewtopic.php?t=386636
i don't get it al..
i think i know what it does and how it works(a little)
but i dont get the: &ulValue in the example, what must be placed in the first arg in the function? or does it return an value at that var?

_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Thu Apr 02, 2009 12:50 pm    Post subject: Reply with quote

When you place an ampersand (&) in front of a variable, you can basically read it as: the address of....

Also, when you place an asterisk (*) in front of a variable (outside it's declaration), it means: the value at this address....

Code:
int x = 2;
// Make 'y' point to 'x'. Move the address of 'x' into 'y'.
// Note the asterisk means we are declaring a pointer, not taking
// the value at the address.
int *y = &x;

// Now we use the asterisk to get the value 'y' points at.
printf("y points to: %d\n", *y);
// y points to: 2

// We can also change 'x' by changing the value 'y' points to.
*y = 3;
printf("x is now: %d\n", x);
// x is now: 3


So, the reason we pass a pointer to the variable in the function, is because the function needs to be able to change what is in the variable directly.
Back to top
View user's profile Send private message
nielskool
Advanced Cheater
Reputation: 0

Joined: 03 Jun 2007
Posts: 65

PostPosted: Thu Apr 02, 2009 12:57 pm    Post subject: Reply with quote

was reading it.. gave you a repp and i thought hmm this code wasn't there yet right..Razz
went back to the page and reloaded it.. you added something.. already got it but thanks, now i am sure

//edit

hmm.. get an error.. what do i have to do with:
Code:

#define ReadPointer(x, y, ...) _ReadPointer(x, y, __VA_ARGS__, OFFSETS_END)

because it gives me:
[Error] C:\Users\niels kool\Documents\C-Free\Temp\Untitled1.cpp:27: badly punctuated parameter list in `#define'

_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
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