
C/C++
文章平均质量分 81
iteye_12922
这个作者很懒,什么都没留下…
展开
-
C语言写的日期比较
最近无聊,写了一个日期比较的C程序,发上来供大家拍砖![code="c"]#include bool isRun(int year);int year(int year1,int year2);int month(struct day day1,struct day day2);int day(int day1,int day2);struct day{...2009-03-09 17:42:59 · 1458 阅读 · 0 评论 -
C语言编写的单链表(测试通过)
#ifndef List_H#define List_H#endiftypedef int Item;typedef struct node * PNode;typedef struct node{ Item item; PNode next;} Node;typedef PNode Position;typedef PNode ...原创 2014-10-11 16:17:41 · 250 阅读 · 0 评论 -
造成segment fault,产生core dump的可能原因
造成segment fault,产生core dump的可能原因1.内存访问越界 a) 由于使用错误的下标,导致数组访问越界 b) 搜索字符串时,依靠字符串结束符来判断字符串是否结束,但是字符串没有正常的使用结束符 c) 使用strcpy, strcat, sprintf, strcmp, strcasecmp等字符串操作函数,将目标字符串读/写爆。应该使用strncpy, st...原创 2014-10-12 20:29:27 · 160 阅读 · 0 评论