From deaaf3412d01a69fdc4354564fba5506ef65f4c8 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sat, 31 Aug 2013 10:51:48 -0500 Subject: [PATCH] Add print formatting characters --- c.html.markdown | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 #include