Difference between revisions of "C Programming"
From Nerdica Wiki
(→Basic Format Specifiers) |
|||
(One intermediate revision by the same user not shown) | |||
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 /> | ||
+ | %u = a unsigned int<br /> | ||
+ | %lu = a long unsigned int<br /> | ||
+ | %llu = a long long unsigned int<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 | ||
+ | |} |
Latest revision as of 19:41, 7 July 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
%u = a unsigned int
%lu = a long unsigned int
%llu = a long long unsigned int
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 |