C编程语言全面参考手册

需积分: 10 22 下载量 68 浏览量 更新于2024-07-18 收藏 10.07MB PDF 举报
"C in a Nutshell, Second Edition" 是一本由 Peter Prinz 和 Tony Crawford 合著的全面性C语言参考书籍,涵盖了C11标准。这本书旨在为C程序员提供一个可靠、全面的参考资料,作为经典之作"Kernighan & Ritchie"的补充。 本书分为三个部分。第一部分是对C语言的快速介绍,类似经典的"C程序设计语言"(K&R)教程,主要关注C语言本身和预处理器指令,包括1999年引入的ANSI标准扩展。这部分涵盖了以下主题: 1. 数值常量:讨论各种数值类型的表示和常量定义。 2. 类型转换:隐式和显式转换的规则和实践。 3. 表达式与运算符:深入解析C语言中的操作符优先级和结合性。 4. 函数:函数声明、定义、参数传递和返回值处理。 5. 数组:固定长度和可变长度数组的使用。 6. 指针:指针的定义、操作和解引用。 7. 动态内存管理:malloc, calloc, realloc 和 free 等内存分配和释放函数。 8. 输入/输出:stdio库中的输入输出函数如printf, scanf等。 第二部分是C运行时库的详尽参考,概述了标准头文件的内容,并对每个标准库函数进行了描述。这包括但不限于: - 文件操作:fopen, fclose, fread, fwrite等。 - 字符串处理:strcpy, strcat, strcmp等。 - 数学运算:sqrt, pow, sin, cos等。 - 时间和日期处理:time, localtime, mktime等。 第三部分介绍了C程序员的基本工具:编译器、make工具和调试器,特别关注GNU软件集合中的这些工具。这部分帮助读者理解如何编译、链接和调试C程序,以及如何有效地管理项目构建过程。 此外,书中的示例代码丰富,有助于读者理解和应用所学知识。无论是初学者还是经验丰富的开发者,这本书都能提供必要的参考和指导,成为他们桌面上最常翻阅的参考资料。 "C in a Nutshell, Second Edition" 是一本全面而实用的C语言参考书,不仅适合想要巩固基础的程序员,也适合那些需要解决特定问题或查找特定功能详细信息的专业人士。
2018-04-27 上传
This book is a complete reference to the C programming language and the C runtime library. As an “In a Nutshell” book, its purpose is to serve as a convenient, reliable companion for C programmers in their day-to-day work. It describes all the elements of the language and illustrates their use with numerous examples. The present description of the C language is based on the 2011 international C standard, ISO/IEC 9899:2011, widely known as C11. This standard supersedes the C99 standard, ISO/IEC 9899:1999, and its Technical Corrigenda, TC1 of 2001, TC2 of 2004, and TC3 of 2007. The first international C standard, ISO/IEC 9899:1990, was published in 1990 and supplemented in 1995 by Normative Addendum 1 (ISO/IEC 9899/AMD1:1995). The 1990 ISO/IEC standard corresponds to the ANSI standard X3.159, which was ratified in late 1989 and is commonly called ANSI C or C89. The new features of the 2011 C standard are not yet fully supported by all compilers and standard library implementations. In this book, we have therefore labeled 2011 features—such as multithreading, type-generic macros, and new standard library functions—with the abbreviation C11. Extensions that were introduced by the C99 standard are labeled with the abbreviation C99. This book is not an introduction to programming in C. Although it covers the fundamentals of the language, it is not organized or written as a tutorial. If you are new to C, we assume that you have read at least one of the many introductory books, or that you are familiar with a related language, such as Java or C++.