View Single Post
Old 04-08-2009, 09:47 PM   #26 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

I haven't done any in a while. This certainly is not inventive, just lower level that need be.
C++
Code:
    int a = 0;
    int b = 1;
    int temp;

    int *addrA = &a;
    int *addrB = &b;
    temp = *addrA;
    a = *addrB;
    b = temp;
What this code does:
Assign 2 ints with the value of zero and one respectively
Assign two pointers to the memory address of each
Manually go into memory and get the values opposed to letting C++ do it.
__________________

Village Idiot is offline  
Reply With Quote