(ת)Ò»¸ö¼òµ¥µÄ´øÍ·Î²Ö¸Õëµ¥ÏòÁ´±í£¨CʵÏÖ£©
ÓÃCдÁËÒ»¸ö´øÍ·Î²Ö¸ÕëµÄµ¥ÏòÁ´±í£¬½öÔÚβ²¿½øÐвåÈë²Ù×÷£¬ÔÚÈÎÒâλÖýøÐÐɾ³ý²Ù×÷¡£ÒòΪֻÓõ½ÕâôЩ¹¦ÄÜ£¬ÓÖÒòΪÀÁ£¬ËùÒÔûÓÐÀ©Õ¹¡£ÒòΪ²åÈëÊǹ̶¨ÔÚβ²¿½øÐУ¬´øÒ»¸öβָÕëµÄºÃ´¦ÊÇÏÔ¶øÒ×¼ûµÄ¡£µ±È»É¾³ýʱҪ¸¶³öһЩ¿ªÏú¡£
¡¡¡¡list.h
¡¡¡¡£££££££££££££££££££££££££££££££££££££££££££
¡¡¡¡/* list.h
¡¡¡¡** Copyright 2004 Coon Xu.
¡¡¡¡** Author: Coon Xu
¡¡¡¡** Date: 06 Sep 2004
¡¡¡¡*/
¡¡¡¡#ifndef LIST_H
¡¡¡¡#define LIST_H
¡¡¡¡#include <stdio.h>
¡¡¡¡#include <stdlib.h>
¡¡¡¡struct listnode
¡¡¡¡{
¡¡¡¡ struct listnode* next;
¡¡¡¡ int data;
¡¡¡¡};
¡¡¡¡struct list
¡¡¡¡{
¡¡¡¡ struct listnode* head;
¡¡¡¡ struct listnode* tail;
¡¡¡¡ int count;
¡¡¡¡};
¡¡¡¡void list_init(struct list*);
¡¡¡¡void list_insert(struct list*, struct listnode*);
¡¡¡¡int list_delete(struct list*, struct listnode*);
¡¡¡¡#endif
¡¡¡¡££££££££££££££££££££££££££££££££££££££££££
¡¡¡¡list.c
¡¡¡¡££££££££££££££££££££££££££££££££££££££££££
¡¡¡¡/* list.c
¡¡¡¡** Copyright 2004 Coon Xu.
¡¡¡¡** Author: Coon Xu
¡¡¡¡** Date: 06 Sep 2004
¡¡¡¡*/
¡¡¡¡#include "list.h"
¡¡¡¡void list_init(struct list* myroot)
¡¡¡¡{
¡¡¡¡ myroot->count = 0;
¡¡¡¡ myroot->head = NULL;
¡¡¡¡ myroot->tail = NULL;
¡¡¡¡}
¡¡¡¡void list_insert(struct list* myroot, struct listnode* mylistnode)
¡¡¡¡{
¡¡¡¡ myroot->count++;
¡¡¡¡
¡¡¡¡ mylistnode->next = NULL;
¡¡¡¡ if(myroot->head == NULL)
¡¡¡¡ {
¡¡¡¡ myroot->head = mylistnode;
¡¡¡¡ myroot->tail = mylistnode;
¡¡¡¡ }
¡¡¡¡ else
¡¡¡¡ {
¡¡¡¡ myroot->tail->next = mylistnode;
¡¡¡¡ myroot->tail = mylistnode;
¡¡¡¡ }
¡¡¡¡}
¡¡¡¡int list_delete(struct list* myroot, struct listnode* mylistnode)
¡¡¡¡{
¡¡¡¡ struct listnode* p_listnode = myroot->head;
¡¡¡¡ struct listnode* pre_listnode;
¡¡¡¡
¡¡¡¡ //myroot is empty
¡¡¡¡ if(p_listnode == NULL)
¡¡¡¡ {
¡¡¡¡ return 0;
¡¡¡¡ }
¡¡¡¡
¡¡¡¡ if(p_listnode =
Ïà¹ØÎĵµ£º
ʲôÊÇ¿ÕÖ¸Õë³£Á¿£¨null pointer constant£©?
[6.3.2.3-3] An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.
ÕâÀï¸æËßÎÒÃÇ£º0¡¢0L¡¢'\0'¡¢3 - 3¡¢0 * 17 £¨ËüÃǶ¼ÊÇ“integer constant expression”£©ÒÔ¼° (void*)0 µÈ¶¼ÊÇ¿Õ ......
1£ºÀàËÆjunitµÄ¶ÏÑÔ£¬Ö»ÊÇÔÚassertÖеĶÏÑÔ£¬Èç¹û²»Âú×ãµÄ»°¾Í³ÌÐòÍ˳ö¡£
±ÈÈç
#include <assert.h>
int main(void)
{
assert(6 < 5);
system("pause");
return 0;
}
ÔÚÖ´Ðе½assert(6 < 5);
µÄʱºòÒòΪ²»Âú×ã¶ÏÑÔ£¬ÓÚÊdzÌÐòÍ˳ö¡£
Èç¹û²»ÏëÈÃassert(6 < 5)Æð×÷Ó㬾ÍÔÚ×îÉÏÃæÌí¼Óºê¶¨Òå# ......
×î½üʵÔÚÊÇ̫æÁË£¬ÕâÆªÕûÕû¾ÍÍÆ³ÙÁË1¸öÔÂÁË£¬ÊµÔÚÊǶԲ»Æð¡£Ö®Ç°±¾´òËãÕâ¸öÄ£¿é¾Í½áÊøÁË£¬Îļþ²Ù×÷¾Í²»Ð´ÁË£¬µ«ÊÇÎļþ²Ù×÷ÓÖÊÇÒ»¸öºÜÖØÒªµÄ¶«Î÷£¬¶øÇÒÒ²¸ÕºÃÄܹ»×ܽá֮ǰÎÒÃÇѧϰµÄËùÓÐ֪ʶ¡£Í¬Ê±Ò²ÎªÁ˽«Îļþ²Ù×÷Õâ¸ö³õѧÕßÈÏΪºÜÉñÃØµÄ¶«Î÷¸ø±¾ÖÊ»¯¡£Òò´Ë£¬±¾Æª½«ÖðÒ»½éÉÜCÓïÑÔµÄÎļþ²Ù×÷¡££¨±¾Ä£¿éµÄÃüÃû±¾À´ÊÇÏëC\C++Ò ......
/*=================================
.* The Standard include file.
.*
.*===============================*/
#include <stdio.h>
#include <stdlib.h>
/*=================================
.*
.* The extend include file.
.*
.*===============================*/
#include "sqlit ......