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 * reference = (type *) address; \
- type & name = * (reference); \
- using namespace std;
- int main (void) {
- void * initialized;
- initialized = (void*) calloc (1,sizeof(int));
- 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