Getting the data at an address
If you have an address, you can get the data stored there using the * operator. Have the log display the value of the integer stored at addressofI.
int main(int argc, const char * argv[]) { int i = 17; int *addressOfI = &i; printf("i stores its value at %p\n", addressOfI); printf("this function starts at %p\n", main); printf("the int stored at addressOfI is %d\n", *addressOfI); return 0; }
Notice that the asterisk is used two ...
Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.