Skip to content

Instantly share code, notes, and snippets.

@cgmb
Created September 23, 2015 07:59
Show Gist options
  • Save cgmb/9bff323ee7f2fb5acfaf to your computer and use it in GitHub Desktop.
Save cgmb/9bff323ee7f2fb5acfaf to your computer and use it in GitHub Desktop.
Show that C strings are arrays of numeric values
#include <stdio.h>
int main() {
char hello[] = "Hello World!";
int i;
for (i = 0; i < 13; ++i) {
printf("%c = %d\n", hello[i], (int)hello[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment