Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1887429
  • 博文数量: 333
  • 博客积分: 10791
  • 博客等级: 上将
  • 技术积分: 4314
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-08 07:39
文章分类

全部博文(333)

文章存档

2015年(1)

2011年(116)

2010年(187)

2009年(25)

2008年(3)

2007年(1)

分类: C/C++

2010-01-15 21:43:27

总结:
   1、NUL、NULL和'\0':
NUL是ASCII字符集中'\0'字符的名字,它的字节模式为全0。NULL指向一个值为0的指针。它们都是整型值,其值相同,所以可以互换。符号NULL在头文件“stdio.h”中定义。

   
   2、第一章所涉及的函数:
   1)、 fgetc():reads the next character from  stream  and  returns  it  as an unsigned char cast to an int, or EOF on end of file or error.
   2)、 getc()  is equivalent to fgetc() except that it may be plemented as a macro which evaluates stream more than once.
   3)、 getchar() is equivalent to getc(stdin).
   4)、 gets() reads a line from stdin into the buffer pointed to  by  s  until either  a  terminating newline or EOF, which it replaces with '\0'.  No check for buffer overrun is performed (see BUGS below).
   5)、 fgets() reads in at most one less than size characters from stream  and stores  them  into  the buffer pointed to by s.  Reading stops after an EOF or a newline.  If a newline is read, it is stored into the  buffer.A '\0' is stored after the last character in the buffer.
   6)、 ungetc()  pushes  c  back to stream, cast to unsigned char, where it is available for subsequent read operations.  Pushed-back characters  will be returned in reverse order; only one pushback is guaranteed.
   7)、 fputc() writes the character c, cast to an unsigned char, to stream.
   8)、 fputs() writes the string s to stream, without its trailing '\0'.
   9)、 putc()  is equivalent to fputc() except that it may be implemented as a macro which evaluates stream more than once.
   10)、putchar(c); is equivalent to putc(c,stdout).
   11)、puts() writes the string s and a trailing newline to stdout.

   3、转义符的应用
   1)、'\a' 警告字符
   2)、'\b' 退格
   3)、'\r' 回车
   4)、'\v' 垂直制表符
   5)、'\ddd' ddd表示八进制数字。整个转义符表示这八进制数所代表的字符
   6)、'\xddd' 同上,不过哦ddd代表十六进制数

阅读(1339) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~