9p / who / tweedy / 9C / 1


Exercise 1.2: Print Escape Characters

Code

#include <u.h>
#include <libc.h>

/* Exercise 1.2: what happens when print()'s argument is an escape character? */
void main()
{
    print("Hello, world ☺\n");
    print("backslash: \\\n");
    print("formfeed: \f\n");

    exits(0);
}

Output

$ 9c esc.c; 9l esc.o -o esc
$ ./esc 
Hello, world ☺
backslash: \
formfeed: 





tweedy