summaryrefslogtreecommitdiffhomepage
path: root/c.html.markdown
diff options
context:
space:
mode:
authorLevi Bostian <levi.bostian@gmail.com>2013-08-31 10:51:48 -0500
committerLevi Bostian <levi.bostian@gmail.com>2013-08-31 10:51:48 -0500
commitdeaaf3412d01a69fdc4354564fba5506ef65f4c8 (patch)
tree3882606577317af7946200547a6ccaf5474e011e /c.html.markdown
parent58cd4b274f4ef6dce15bf30eccad4691aaf835ed (diff)
Add print formatting characters
Diffstat (limited to 'c.html.markdown')
-rw-r--r--c.html.markdown13
1 files changed, 13 insertions, 0 deletions
diff --git a/c.html.markdown b/c.html.markdown
index c8c3e33b..a9fd8e50 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -23,9 +23,22 @@ Multi-line comments look like this. They work in C89 as well.
//Special characters:
'\n' // newline character
'\t' // tab character
+'\v' // vertical tab
+'\f' // new page
+'\r' // carriage return
'\b' // backspace character
'\0' // null character
+//print formatting:
+"%d" // integer
+"%3d" // minimum length of 3 digits for integer (right justifies text)
+"%s" // string
+"%f" // float
+"%3.2f" // minimum 3 digits left and 2 digits right decimal float
+"%7.4s" // (can do with strings too)
+"%c" // char
+"%p" // pointer
+
// Import headers with #include
#include <stdlib.h>
#include <stdio.h>