2011年4月27日
摘要: 源自《The C Programming Language》P28 pr2-1: 编写一个程序以确定分别由signed及unsigned限定的char,short,int,long类型变量的取值范围。 参考代码:main.c 1 #include <stdio.h> 2 #include <limits.h> 3 #include <float.h> 4 5 int main() 6 { 7 8 printf("the range of char: %d ~ %d\n", SCHAR_MIN, SCHAR_MAX); 9 printf(& 阅读全文
posted @ 2011-04-27 23:59 将军之盾 阅读(3145) 评论(0) 推荐(2) 编辑
摘要: 源自《The C Programming Language》P25 p1-23: 编写一个删除C语言程序中所以的注释语句。要正确处理带引号的字符串和字符常量。在C语言中,注释不允许嵌套。 参考代码:main.c 1 /* 2 #include <stdio.h> 3 4 #define MAXLINE 1000 5 6 int getLine(char s[], int lim); 7 void copy(char to[], char from[]); 8 void delNotes(char **s, int row); 9 10 int main() 11 { 12 13 i 阅读全文
posted @ 2011-04-27 01:21 将军之盾 阅读(836) 评论(0) 推荐(0) 编辑