| chars/char-constants.c - Tegnkonstanterne i et C program. | Lektion 10 - slide 4 : 51 Program 1 |
#include <stdio.h>
int main(void) {
char ch[] = {'\n', '\t', '\'', '\\',
'\12', '\141', '\156',
'\xa', '\x61', '\x6e'
};
int i;
for(i = 0; i <= sizeof(ch)/sizeof(char) - 1; i++)
printf("ch[%d] = %c (as char) and %d (as integer)\n", i, ch[i], ch[i]);
return 0;
}