Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Reply
Posted 2006-02-07, 11:17 AM in reply to Medieval Bob's post starting "pS is a pointer that, as its value, has..."
all right then, i'll try to practice it. but one more question..... mjordan2nd's link says that the pointer point to an address in the memory, right? but you say that it has to do w/ the variable's value, right? so which one is right? they can't both be correct, right? so which one is it? and sorry for being a pain in the rear w/ all this confusion i have. i just don't catch things so easily sometimes thanks for your help guys.
Old
Profile PM WWW Search
sciencekid is neither ape nor machine; has so far settled for the in-betweensciencekid is neither ape nor machine; has so far settled for the in-between
 
 
sciencekid
 



 
Reply
Posted 2006-02-07, 04:56 PM in reply to sciencekid's post starting "all right then, i'll try to practice..."
They are both correct. A pointer holds an address in memory. If you outputted the value of a pointer, you would get a memory address, which pretty much would look like random garble. However, you can use a pointer to change the value of a variable as well. By using the correct command, you basically say change the value of the address a pointer is pointing to. For instance, lets say pointer i points to variable x, and variable x's location in memory is 1234:5678. Lets say x is initially 10. If you wanted to change x's value to 20, you could do so using the pointer like so:

Code:
 *i = 20;
What that code does is it says, go to the address that i is holding, which also happens to be variable x's location, and change the value that address i is holding to 20, which therefore also changes x's value.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:38 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.