boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

101-char-escapes.c (491B)


      1 /* Character escape sequences per CC.md §Lexical syntax:
      2  * \n \t \r \\ \' \" \0 \xNN \NNN */
      3 
      4 int main(int argc, char **argv) {
      5     if ('\n' != 10)  return 1;
      6     if ('\t' != 9)   return 2;
      7     if ('\r' != 13)  return 3;
      8     if ('\\' != 92)  return 4;
      9     if ('\'' != 39)  return 5;
     10     if ('\"' != 34)  return 6;
     11     if ('\0' != 0)   return 7;
     12     if ('\x41' != 65) return 8;
     13     /* Octal up to 3 digits */
     14     if ('\101' != 65) return 9;
     15     if ('\7'   != 7)  return 10;
     16     return 0;
     17 }