Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <string.h>
- #define declare_at(type,name,address) \
- type & name = *( get_mem ((type*)address) )
- using namespace std;
- template <typename TYPE>
- TYPE get_mem(TYPE address)
- {
- TYPE result = address;
- return result;
- }
- int main (void)
- {
- int initialized[1];
- declare_at (int, pepe, initialized);
- cout << "Value: " << pepe << endl;
- ++pepe;
- cout << "Value: " << pepe << endl;
- cout << "AddressAlloced: " << initialized << endl;
- cout << "AddressOfPepe: " << &pepe << endl;
- return EXIT_SUCCESS;
- }
Add Comment
Please, Sign In to add comment