Difference between revisions of "C Programming"
From Nerdica Wiki
(added keywords and escape sequences tables.) |
(→Basic Format Specifiers) |
||
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 == | == Keywords == |
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 |