#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
int *integerPointer;
int myInteger = 42;
integerPointer = &myInteger;
NSLog(@"Address of myInteger: %p", &myInteger);
NSLog(@"Value pointed by integerPointer: %d", *integerPointer);
*integerPointer = 100;
NSLog(@"New value of myInteger: %d", myInteger);
NSString *stringPointer;
stringPointer = @"Hello, World!";
NSLog(@"String pointed by stringPointer: %@", stringPointer);
NSString *anotherStringPointer = stringPointer;
NSLog(@"String pointed by anotherStringPointer: %@", anotherStringPointer);
if (stringPointer == anotherStringPointer) {
NSLog(@"stringPointer and anotherStringPointer point to the same object");
} else {
NSLog(@"stringPointer and anotherStringPointer do not point to the same object");
}
}
return 0;
}