目錄前言1 introduction1.1 introduction1.2 the c programming language1.3 c standard library1.4 c and other c-based languages1.5 typical c program development environment1.5.1 phase 1: creating a program1.5.2 phases 2 and 3: preprocessing and compiling a c program1.5.3 phase 4: linking1.5.4 phase 5: loading1.5.5 phase 6: execution1.5.6 standard input, standard output and standard error streams1.6 test-driving a c application in windows, linux and mac os x1.6.1 running a c application from the windows command prompt1.6.2 running a c application using gnu c with linux1.6.3 running a c application using gnu c with mac os x1.7 operating systems1.7.1 windows—a proprietary operating system1.7.2 linux—an open-source operating system1.7.3 apple’s mac os x; apple’s ios ? for iphone ? , ipad ? and ipod touch ? devices1.7.4 google’s android2 introduction to c programming2.1 introduction2.2 a simple c program: printing a line of text2.3 another simple c program: adding two integers2.4 arithmetic in c2.5 decision making: equality and relational operators2.6 secure c programming3 control statements: part i3.1 introduction3.2 control structures3.3 the if selection statement3.4 the if … else selection statement3.5 the while repetition statement3.6 class average with counter-controlled repetition3.7 class average with sentinel-controlled repetition3.8 nested control statements3.9 assignment operators3.10 increment and decrement operators3.11 secure c programming4 control statements: part ii4.1 introduction4.2 repetition essentials4.3 counter-controlled repetition4.4 for repetition statement4.5 for statement: notes and observations4.6 examples using the for statement4.7 switch multiple-selection statement4.8 do … while repetition statement4.9 break and continue statements4.10 logical operators4.11 confusing equality ( == ) and assignment ( = ) operators4.12 secure c programming5 functions5.1 introduction5.2 program modules in c5.3 math library functions5.4 functions5.5 function definitions5.6 function prototypes: a deeper look5.7 function call stack and stack frames5.8 headers5.9 passing arguments by value and by reference5.10 random number generation5.11 example: a game of chance5.12 storage classes5.13 scope rules5.14 recursion5.15 example using recursion: fibonacci series5.16 recursion vs. iteration5.17 secure c programming6 arrays6.1 introduction6.2 arrays6.3 defining arrays6.4 array examples6.5 passing arrays to functions6.6 sorting arrays6.7 case study: computing mean, median and mode using arrays6.8 searching arrays6.9 multidimensional arrays6.10 variable-length arrays6.11 secure c programming7 pointers7.1 introduction7.2 pointer variable definitions and initialization7.3 pointer operators7.4 passing arguments to functions by reference7.5 using the const qualifier with pointers7.5.1 converting a string to uppercase using a non-constant pointer to non-constant data7.5.2 printing a string one character at a time using a non-constant pointer to constant data7.5.3 attempting to modify a constant pointer to non-constant data7.5.4 attempting to modify a constant pointer to constant data7.6 bubble sort using pass-by-reference7.7 sizeof operator7.8 pointer expressions and pointer arithmetic7.9 relationship between pointers and arrays7.10 arrays of pointers7.11 case study: card shuffling and dealing simulation7.12 pointers to functions7.13 secure c programming8 characters and strings8.1 introduction8.2 fundamentals of strings and characters8.3 character-handling library8.3.1 functions isdigit , isalpha , isalnum and isxdigit8.3.2 functions islower , isupper , tolower and toupper8.3.3 functions isspace , iscntrl , ispunct , isprint and isgraph8.4 string-conversion functions8.4.1 function strtod8.4.2 function strtol8.4.3 function strtoul8.5 standard input/output library functions8.5.1 functions fgets and putchar8.5.2 function getchar8.5.3 function sprintf8.5.4 function sscanf8.6 string-manipulation functions of the string-handli