Skip to content

Instantly share code, notes, and snippets.

@x5lcfd
Last active August 29, 2015 14:12
Show Gist options
  • Save x5lcfd/f05d11d2f9cf26322cfd to your computer and use it in GitHub Desktop.
Save x5lcfd/f05d11d2f9cf26322cfd to your computer and use it in GitHub Desktop.
A nice trick with symmetric array
static char digits[19] = { '9', '8', '7', '6', '5',
'4', '3', '2', '1','0', '1', '2', '3', '4', '5',
'6', '7', '8', '9' };
static const char* zero = digits + 9;
printf( "%c\n", zero[-1] );
@x5lcfd
Copy link
Author

x5lcfd commented Mar 6, 2015

看的太少了,奇技淫巧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment