summaryrefslogtreecommitdiff
path: root/reference/C/FUNCTIONS/escape.html
blob: 3ba17a33f1a38968cde86454d4dcbe53dd7f9b70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<title>Escape sequences</title>
<head>
<script language="JavaScript">
</script>
</head>
<body bgcolor="#ffffcc">
<hr>
<center><h1>Escape sequences</h1></center>
<hr>
<p>

The following is a list of escape sequences.
<p>
<pre>
	\n 	Newline
	\t	Horizontal Tab
	\v	Vertical Tab
	\b	Backspace
	\r	Carriage Return
	\f	Form feed
	\a	Audible Alert (bell)
	\\	Backslash
	\?	Question mark
	\'	Single quote
	\"	Double quote
	\000	Oct - No one uses Octal unless they have an ICL background...
	\xhh	<a href="hex_tab.html">Hex number</a>
	    	<a href="dec_tab.html">Decimal table</a> just for fun.
        \       Preprocessor line continuation, must be immediately followed 
	        by a newline.
</pre>
These can be used anywhere that C expects to see a character constant.
Must be time for a quick example.
<pre>
	main()
        {
	  char word[]="\x6d\x6f\x64\x65\x6d"; 
	   
	  printf("%s\n", word);
	}
</pre>
Cant you work out what will appear if you ran this program??
<hr>
<h2>Examples:</h2>
<img src=../../GRAPHICS/computer.gif>
<a href="../EXAMPLES/convesc.c"> Example program.</a>



<p>

<hr>
<p>
<center>
<table border=2 width="80%" bgcolor="ivory">
<tr align=center>
<td width="25%">
<a href="../cref.html">                  Top</a>
</td><td width="25%">
<a href="../master_index.html">          Master Index</a>
</td><td width="25%">
<a href="../SYNTAX/keywords.html">                 Keywords</a>
</td><td width="25%">
<a href="funcref.htm">      Functions</a>
</td>
</tr>
</table>
</center>
<p>
<hr>
<address>Martin Leslie 
</address><p>
</body>
</html>