Difference between revisions of "C Programming"

From Nerdica Wiki
Jump to: navigation, search
(added keywords and escape sequences tables.)
Line 1: Line 1:
== Format Specifiers ==
+
== Basic Format Specifiers ==
  
 
%d = an integer whole number = 100<br />
 
%d = an integer whole number = 100<br />
Line 6: Line 6:
 
%s = a string of characters = "Hello World"<br />
 
%s = a string of characters = "Hello World"<br />
 
%p = a machine memory address = 0x0022FF5C<br />
 
%p = a machine memory address = 0x0022FF5C<br />
 +
 +
== Keywords ==
 +
 +
{| style="color:black" cellpadding="2" cellspacing="0" border="1"
 +
|auto
 +
|extern
 +
|sizeof
 +
|-
 +
|break
 +
|float
 +
|static
 +
|-
 +
|case
 +
|for
 +
|struct
 +
|-
 +
|char
 +
|goto
 +
|switch
 +
|-
 +
|const
 +
|if
 +
|typedef
 +
|-
 +
|continue
 +
|int
 +
|union
 +
|-
 +
|default
 +
|long
 +
|unsigned
 +
|-
 +
|do
 +
|register
 +
|void
 +
|-
 +
|double
 +
|return
 +
|volatile
 +
|-
 +
|else
 +
|short
 +
|while
 +
|-
 +
|enum
 +
|signed
 +
|}
 +
 +
== Escape Sequences ==
 +
 +
{| style="color:black" cellpadding="2" cellspacing="0" border="1"
 +
|\n
 +
|newline
 +
|\\
 +
|backslash
 +
|-
 +
|\t
 +
|horizontal tab
 +
|\?
 +
|question mark
 +
|-
 +
|\v
 +
|vertical tab
 +
|\'
 +
|single quote
 +
|-
 +
|\b
 +
|backspace
 +
|\"
 +
|double quote
 +
|-
 +
|\r
 +
|carriage return
 +
|\000
 +
|octal number
 +
|-
 +
|\f
 +
|form feed
 +
|\xhh
 +
|hexadecimal number
 +
|-
 +
|\a
 +
|audible alert
 +
|\0
 +
|null character
 +
|}

Revision as of 14:12, 7 April 2010

Basic Format Specifiers

%d = an integer whole number = 100
%f = a floating point number = 0.123456
%c = a single character = 'A'
%s = a string of characters = "Hello World"
%p = a machine memory address = 0x0022FF5C

Keywords

auto extern sizeof
break float static
case for struct
char goto switch
const if typedef
continue int union
default long unsigned
do register void
double return volatile
else short while
enum signed

Escape Sequences

\n newline \\ backslash
\t horizontal tab \? question mark
\v vertical tab \' single quote
\b backspace \" double quote
\r carriage return \000 octal number
\f form feed \xhh hexadecimal number
\a audible alert \0 null character