04-08-2009, 09:47 PM
|
#26 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
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.
|
|
|
|