Created
January 16, 2012 03:16
-
-
Save justincbeck/1618855 to your computer and use it in GitHub Desktop.
Pointers and address space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assume array is an NSArray of NSString objects | |
NSString *lastFoo = nil; | |
for (NSString *foo in array) | |
{ | |
lastFoo = foo; // Why doesn't foo take on the address of bar? | |
lastFoo = &foo; // Is this better? | |
*lastFoo = &foo; // Or perhaps this? | |
// Other suggestions? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment