没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Pointers On C
Instructor’s Guide
Pointers on C—Instructor´s Guide i
Contents
Chapter 1 A Quick Start ........................................................................................................ 1
Chapter 2 Basic Concepts ...................................................................................................... 7
Chapter 3 Data ....................................................................................................................... 11
Chapter 4 Statements ............................................................................................................. 15
Chapter 5 Operators and Expressions .................................................................................... 23
Chapter 6 Pointers .................................................................................................................. 29
Chapter 7 Functions ............................................................................................................... 37
Chapter 8 Arrays .................................................................................................................... 43
Chapter 9 Strings, Characters, and Bytes .............................................................................. 55
Chapter 10 Structures and Unions ........................................................................................... 69
Chapter 11 Dynamic Memory Allocation ................................................................................ 75
Chapter 12 Using Structures and Pointers ............................................................................... 79
Chapter 13 Advanced Pointer Topics ...................................................................................... 87
Chapter 14 The Preprocessor ................................................................................................... 93
Chapter 15 Input/Output Functions .......................................................................................... 95
Chapter 16 Standard Library .................................................................................................... 119
Chapter 17 Classic Abstract Data Types ................................................................................. 129
Chapter 18 Runtime Environment ........................................................................................... 145
1
A Quick Start
1.1 Questions
1. To make the program easier to read, which in turn makes it easier to maintain later.
3. It is easier to see what a named constant represents, if it is well named, than a literal constant,
which merely displays its value.
4.
"%d %s %g\n"
6. The programmer can put in subscript checks where they are needed; in places where the sub-
script is already known to be correct (for example, from having been checked earlier), there is no
overhead expended in checking it again. But the real reason they are omitted is the fact that sub-
scripts are implemented as pointer expressions, which are described in Chapter 8.
7. More characters would be copied than are actually needed; however, the
output_col would be
updated properly, so the next range of characters would be copied into the output array at the
proper place, replacing any extra characters from the preceding operation. The only potential
problem is that the unbounded
strcpy might copy more characters into the output array than it
has room to hold, destroying some other variables.
1.2 Programming Exercises
1. Watch the solutions for proper use of void declarations and a reasonable style. The first pro-
gram is no place to begin learning bad habits. The program will compile and run on most sys-
tems without the
#include statement.
/*
** Print the message "Hello world!" to the standard output.
*/
#include <stdio.h>
void
main( void )
Solution 1.1
continued . . .
1
剩余149页未读,继续阅读
资源评论
Dorin528
- 粉丝: 20
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功