Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The table shows how to represent character 92, the backslash character, as a C character literal. . Here is how to write a single
The table shows how to represent character 92, the backslash character, as a C character literal. . Here is how to write a single quote as a character literal: '\'' On a somewhat related note, here is how to insert double quotes into a string literal: "I'd like to say \"Hello!\" to my friends!" What to Do Download the file lab4exD. c. Study the C code, then build an executable and run it to see what the output is. Modify the program so that the output is The string in buffer is "In C the value of 20 (4+5) the ASCII character set, which is listed as a table in Figure 1. ASCII is reasonably good for text in English, but is obviously not at all adequate for text in most other human languages. It's possible in C to manage strings that could contain any characters from any written language, but that's an advanced topic that won't be covered in ENCM 335. Most of Figure 1 is self-explanatory, but there are a few things about it that could use a little extra explanation ... . The codes corresponding to decimal number from 0 up to and including 31, and also 127, are called control characters. Most of them have very little use in modern computing, but some of them are very important, such as 0-the null character, 9-the tab character, 10 the newline character, and a few others. Figure 1: Table of the ASCII character set, copied from a Linux manual page. Oct Dec Hex Char 000 0 001 1 2 002 003 3 004 4 014 12 015 13 005 5 006 6 007 7 010 8 011 9 09 012 10 CA 013 11 CB oc 016 14 017 15 020 16 021 17 022 18 023 19 024 20 025 026 027 030 031 032 033 034 035 036 037 *#06#8889*************** 21 22 IT \ LF (nev line) VT v (vertical tab) (form feed) FF CR (carriage ret) 30 (shift out) OF SI (shift in) 10 11 12 DLE (data link escape) DCI (device control 1) DC2 (device control 2) 13 DC3 (device control 3) DC4 (device control 4) NAK (negative ack.) SYH (synchronous idle) ETB (end of trans. blk) CAN (cancel) 14 EM (end of medium) SUB (substitute) 18 BSC (escape) FS (file separator) 10 1D GS (group separator) 1E RS (record separator) US (unit separator) 32 20 SPACE 23 24 25 26 27 28 29 30 31 33 35 36 37 38 39 40 42 040 041 042 043 044 045 046 047 050 051 062 053 054 055 056 46 067 47 2F 060 48 30 061 49 062 50 43 44 45 34 22 2328384888 00 01 02 57 03 04 072 58 073 074 05 06 07 08 59 075 61 076 077 62 OD DE 63 15 16 17 033d9c9cERRARESERRSANRE 18 19 1A 1F 21 23 24 25 26 27 29 24 28 20 20 28 1 2 063 51 33 3 064 52 34 4 065 53 35 5 31 32 000 54 34 6 067 55 37 7 070 56 071 NUL 10 SOH (start of heading). STX (start of text) ETX (end of text) EOT (end of transmission) 388885 ENQ (enquiry) ACK (acknowledge) BEL \a (boll) BS b 30 3D F . 37 # $ % 38 8 39 9 3A # 0 (backspace) (horizontal tab) > Oct Dec Hex Char 100 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117 120 121 122 123 124 125 126 127 130 131 132 133 64 152 153 154 155 156 65 RRRRRRRR8=223852 #993980993999993323333333333333333363838880BFFFFFARRRRRRRRRR 157 160 66 161 162 163 164 165 166 167 170 171 172 173 174 67 175 176 177 68 69 70 71 72 73 74 75 76 77 78 79 80 81 63 84 86 87 134 92 89 135 93 136 137 140 141 142 90 91 94 96 143 144 145 146 147 103 96 97 98 99 150 104 100 151 105 101 102 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 40 127 41 42 43 44 45 46 47 48 49 44 411 40 40 4K 50 61 52 53 54 56 56 57 58 59 SA 58 50 SE 57 61 64 65 66 67 64 6C 6E 65 70 71 72 73 74 75 76 77 78 79 7A 78 7C 7D TE A B C D E F G K I J X L M N 0 P Q R S T U V V X Y z [ 1 R b C d . # 8 A S 3 x 1 11 B 0 P 9 I t u V V y 2 ( 1 } DEL 3 #include 4 5 6 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 8 9 10 11 12 13 14 15 16 17 18 19 20 21 int main(void) { char buffer[80]; // enough space for a string of length
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Note to Reviewer The editor removes the trailing closing brackets of my code snippets In this one it ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started