#include <stdio.h>
#define POS "@@C\x1"
#define SIZE 23
#define SILLY(x) (SIZE + x)
#define SILLY2(x) (SIZE * 2 + x * 2)
char s1[] = "m\000"; /* character 'm' followed by char containing 0 octal */
char s2[] = "n\x05"; /* character 'm' followed by char containing 05 hex */
char s3[] = "o\a"; /* \attention = BELL */
char s4[] = "p\r"; /* \return = CR */
char s5[] = "q\n"; /* \newline = LF */
char s6[] = "r\t"; /* \tab = TAB */
char s7[] = "s\f"; /* \form feed = FF (but in fact */
/* you need ANSI escape codes on UNIX */
char s8[] = POS;
/* function to print out a character array character by character with
each character in () unless its code is less than 31 , then the hex code
for that character */
/* str is pointer to first character */
/* count is the character count */
void list (char *str, int count)
{
for (; count > 0; count--)
printf (" (%c) %02X", *str
> 31 ? *str
: '?', *str
++);
}
void main (void)
{
int x;
x = SILLY (3);
list (s1, 2);
list (s2, 2);
list (s3, 2);
list (s4, 2);
list (s5, 2);
list (s6, 2);
list (s7, 2);
list (s8, 4);
}