/ Sams Teach Yourself C in 21 Days (6th Edition)
/ STYC216E.ISO / mac / Examples / Day07 / escape.c ![]() | next > |
MacBinary | 2002-04-19 | 1.8 KB | [TEXT/LMAN] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
66% | dexvert | Compact Compressed (Unix) (archive/compact) | ext | Supported |
10% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
1% | dexvert | Text File (text/txt) | fallback | Supported |
100% | file | MacBinary II, Fri Apr 19 23:08:10 2002, modified Fri Apr 19 23:08:10 2002, creator 'LMAN', type ASCII, 1179 bytes "escape.c" , at 0x51b 286 bytes resource | default (weak) | |
99% | file | data | default | |
74% | TrID | Macintosh plain text (MacBinary) | default | |
25% | TrID | MacBinary 2 | default (weak) | |
100% | siegfried | fmt/1762 MacBinary (II) | default | |
100% | lsar | MacBinary | default |
id metadata | |
---|---|
key | value |
macFileType | [TEXT] |
macFileCreator | [LMAN] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 65 73 63 61 70 65 | 2e 63 00 00 00 00 00 00 |..escape|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4c 4d 41 | 4e 00 00 ff ff ff ff 00 |.TEXTLMA|N.......|
|00000050| 00 00 00 00 00 04 9b 00 | 00 01 1e b8 e6 8c 1a b8 |........|........|
|00000060| e6 8c 1a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 50 e2 00 00 |........|....P...|
|00000080| 2f 2a 20 44 65 6d 6f 6e | 73 74 72 61 74 69 6f 6e |/* Demon|stration|
|00000090| 20 6f 66 20 66 72 65 71 | 75 65 6e 74 6c 79 20 75 | of freq|uently u|
|000000a0| 73 65 64 20 65 73 63 61 | 70 65 20 73 65 71 75 65 |sed esca|pe seque|
|000000b0| 6e 63 65 73 20 2a 2f 0d | 0a 0d 0a 23 69 6e 63 6c |nces */.|...#incl|
|000000c0| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0d 0a 0d |ude <std|io.h>...|
|000000d0| 0a 23 64 65 66 69 6e 65 | 20 51 55 49 54 20 20 33 |.#define| QUIT 3|
|000000e0| 0d 0a 0d 0a 69 6e 74 20 | 20 67 65 74 5f 6d 65 6e |....int | get_men|
|000000f0| 75 5f 63 68 6f 69 63 65 | 28 20 76 6f 69 64 20 29 |u_choice|( void )|
|00000100| 3b 0d 0a 76 6f 69 64 20 | 70 72 69 6e 74 5f 72 65 |;..void |print_re|
|00000110| 70 6f 72 74 28 20 76 6f | 69 64 20 29 3b 0d 0a 0d |port( vo|id );...|
|00000120| 0a 69 6e 74 20 6d 61 69 | 6e 28 20 76 6f 69 64 20 |.int mai|n( void |
|00000130| 29 0d 0a 7b 0d 0a 20 20 | 20 20 69 6e 74 20 63 68 |)..{.. | int ch|
|00000140| 6f 69 63 65 20 3d 20 30 | 3b 0d 0a 0d 0a 20 20 20 |oice = 0|;.... |
|00000150| 20 77 68 69 6c 65 20 28 | 63 68 6f 69 63 65 20 21 | while (|choice !|
|00000160| 3d 20 51 55 49 54 29 0d | 0a 20 20 20 20 7b 0d 0a |= QUIT).|. {..|
|00000170| 20 20 20 20 20 20 20 63 | 68 6f 69 63 65 20 3d 20 | c|hoice = |
|00000180| 67 65 74 5f 6d 65 6e 75 | 5f 63 68 6f 69 63 65 28 |get_menu|_choice(|
|00000190| 29 3b 0d 0a 0d 0a 20 20 | 20 20 20 20 20 69 66 20 |);.... | if |
|000001a0| 28 63 68 6f 69 63 65 20 | 3d 3d 20 31 29 0d 0a 20 |(choice |== 1).. |
|000001b0| 20 20 20 20 20 20 20 20 | 20 20 70 72 69 6e 74 66 | | printf|
|000001c0| 28 22 5c 6e 42 65 65 70 | 69 6e 67 20 74 68 65 20 |("\nBeep|ing the |
|000001d0| 63 6f 6d 70 75 74 65 72 | 5c 61 5c 61 5c 61 22 20 |computer|\a\a\a" |
|000001e0| 29 3b 0d 0a 20 20 20 20 | 20 20 20 65 6c 73 65 0d |);.. | else.|
|000001f0| 0a 20 20 20 20 20 20 20 | 7b 0d 0a 20 20 20 20 20 |. |{.. |
|00000200| 20 20 20 20 20 20 69 66 | 20 28 63 68 6f 69 63 65 | if| (choice|
|00000210| 20 3d 3d 20 32 29 0d 0a | 20 20 20 20 20 20 20 20 | == 2)..| |
|00000220| 20 20 20 20 20 20 20 70 | 72 69 6e 74 5f 72 65 70 | p|rint_rep|
|00000230| 6f 72 74 28 29 3b 0d 0a | 20 20 20 20 20 20 20 7d |ort();..| }|
|00000240| 0d 0a 20 20 20 20 7d 0d | 0a 20 20 20 20 70 72 69 |.. }.|. pri|
|00000250| 6e 74 66 28 22 59 6f 75 | 20 63 68 6f 73 65 20 74 |ntf("You| chose t|
|00000260| 6f 20 71 75 69 74 21 5c | 6e 22 29 3b 0d 0a 0d 0a |o quit!\|n");....|
|00000270| 20 20 20 20 72 65 74 75 | 72 6e 20 30 3b 0d 0a 7d | retu|rn 0;..}|
|00000280| 0d 0a 0d 0a 69 6e 74 20 | 67 65 74 5f 6d 65 6e 75 |....int |get_menu|
|00000290| 5f 63 68 6f 69 63 65 28 | 20 76 6f 69 64 20 29 0d |_choice(| void ).|
|000002a0| 0a 7b 0d 0a 20 20 20 20 | 69 6e 74 20 73 65 6c 65 |.{.. |int sele|
|000002b0| 63 74 69 6f 6e 20 3d 20 | 30 3b 0d 0a 0d 0a 20 20 |ction = |0;.... |
|000002c0| 20 20 64 6f 0d 0a 20 20 | 20 20 7b 0d 0a 20 20 20 | do.. | {.. |
|000002d0| 20 20 20 20 20 70 72 69 | 6e 74 66 28 20 22 5c 6e | pri|ntf( "\n|
|000002e0| 22 20 29 3b 0d 0a 20 20 | 20 20 20 20 20 20 70 72 |" );.. | pr|
|000002f0| 69 6e 74 66 28 20 22 5c | 6e 31 20 2d 20 42 65 65 |intf( "\|n1 - Bee|
|00000300| 70 20 43 6f 6d 70 75 74 | 65 72 22 20 29 3b 0d 0a |p Comput|er" );..|
|00000310| 20 20 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 20 | |printf( |
|00000320| 22 5c 6e 32 20 2d 20 44 | 69 73 70 6c 61 79 20 52 |"\n2 - D|isplay R|
|00000330| 65 70 6f 72 74 22 29 3b | 0d 0a 20 20 20 20 20 20 |eport");|.. |
|00000340| 20 20 70 72 69 6e 74 66 | 28 20 22 5c 6e 33 20 2d | printf|( "\n3 -|
|00000350| 20 51 75 69 74 22 29 3b | 0d 0a 20 20 20 20 20 20 | Quit");|.. |
|00000360| 20 20 70 72 69 6e 74 66 | 28 20 22 5c 6e 22 20 29 | printf|( "\n" )|
|00000370| 3b 0d 0a 20 20 20 20 20 | 20 20 20 70 72 69 6e 74 |;.. | print|
|00000380| 66 28 20 22 5c 6e 45 6e | 74 65 72 20 61 20 73 65 |f( "\nEn|ter a se|
|00000390| 6c 65 63 74 69 6f 6e 3a | 22 20 29 3b 0d 0a 0d 0a |lection:|" );....|
|000003a0| 20 20 20 20 20 20 20 20 | 73 63 61 6e 66 28 20 22 | |scanf( "|
|000003b0| 25 64 22 2c 20 26 73 65 | 6c 65 63 74 69 6f 6e 20 |%d", &se|lection |
|000003c0| 29 3b 0d 0a 0d 0a 20 20 | 20 20 20 7d 77 68 69 6c |);.... | }whil|
|000003d0| 65 20 28 20 73 65 6c 65 | 63 74 69 6f 6e 20 3c 20 |e ( sele|ction < |
|000003e0| 31 20 7c 7c 20 73 65 6c | 65 63 74 69 6f 6e 20 3e |1 || sel|ection >|
|000003f0| 20 33 20 29 3b 0d 0a 0d | 0a 20 20 20 20 20 72 65 | 3 );...|. re|
|00000400| 74 75 72 6e 20 73 65 6c | 65 63 74 69 6f 6e 3b 0d |turn sel|ection;.|
|00000410| 0a 7d 0d 0a 0d 0a 76 6f | 69 64 20 70 72 69 6e 74 |.}....vo|id print|
|00000420| 5f 72 65 70 6f 72 74 28 | 20 76 6f 69 64 20 29 0d |_report(| void ).|
|00000430| 0a 7b 0d 0a 20 20 20 20 | 20 70 72 69 6e 74 66 28 |.{.. | printf(|
|00000440| 20 22 5c 6e 53 41 4d 50 | 4c 45 20 52 45 50 4f 52 | "\nSAMP|LE REPOR|
|00000450| 54 22 20 29 3b 0d 0a 20 | 20 20 20 20 70 72 69 6e |T" );.. | prin|
|00000460| 74 66 28 20 22 5c 6e 5c | 6e 53 65 71 75 65 6e 63 |tf( "\n\|nSequenc|
|00000470| 65 5c 74 4d 65 61 6e 69 | 6e 67 22 20 29 3b 0d 0a |e\tMeani|ng" );..|
|00000480| 20 20 20 20 20 70 72 69 | 6e 74 66 28 20 22 5c 6e | pri|ntf( "\n|
|00000490| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 5c 74 3d 3d 3d 3d 3d |========|=\t=====|
|000004a0| 3d 3d 22 20 29 3b 0d 0a | 20 20 20 20 20 70 72 69 |==" );..| pri|
|000004b0| 6e 74 66 28 20 22 5c 6e | 5c 5c 61 5c 74 5c 74 62 |ntf( "\n|\\a\t\tb|
|000004c0| 65 6c 6c 20 28 61 6c 65 | 72 74 29 22 20 29 3b 0d |ell (ale|rt)" );.|
|000004d0| 0a 20 20 20 20 20 70 72 | 69 6e 74 66 28 20 22 5c |. pr|intf( "\|
|000004e0| 6e 5c 5c 62 5c 74 5c 74 | 62 61 63 6b 73 70 61 63 |n\\b\t\t|backspac|
|000004f0| 65 22 20 29 3b 0d 0a 20 | 20 20 20 20 70 72 69 6e |e" );.. | prin|
|00000500| 74 66 28 20 22 5c 6e 2e | 2e 2e 5c 74 5c 74 2e 2e |tf( "\n.|..\t\t..|
|00000510| 2e 22 29 3b 0d 0a 7d 0d | 0a 0d 0a 00 00 00 00 00 |.");..}.|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000590| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|000005a0| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|000005b0| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000680| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000690| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+