Created
May 14, 2012 19:51
-
-
Save SlaunchaMan/2696148 to your computer and use it in GitHub Desktop.
Fun with C strings
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
NSString *c = @"C"; | |
NSString *a = @"A"; | |
const char *cValue = [c cStringUsingEncoding:NSASCIIStringEncoding]; | |
const char *aValue = [a cStringUsingEncoding:NSASCIIStringEncoding]; | |
NSLog(@"The value of 'C' - 'A' is %d", (int)(cValue[0] - aValue[0])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment