(ת)Ò»¸ö¼òµ¥µÄ´øÍ·Î²Ö¸Õëµ¥ÏòÁ´±í£¨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 =
Ïà¹ØÎĵµ£º
¸Õ¿ªÊ¼Ñ§C/C++ʱ£¬Ò»Ö±¶Ô×Ö·û´®´¦Àíº¯ÊýÒ»Öª°ë½â£¬ÕâÀïÁоÙC/C++×Ö·û´®´¦Àíº¯Êý£¬Ï£Íû¶Ô³õѧÕßÓÐÒ»¶¨µÄ°ïÖú¡£
C£º
char st[100];
1. ×Ö·û´®³¤¶È
strlen(st);
2. ×Ö·û´®±È½Ï
strcmp(st1,st2);
strncmp(st1,st2,n); °Ñst1,st2µÄǰn¸ö½øÐбȽϡ£
3. ¸½¼Ó
& ......
ÔÚC#Àï´´½¨ºÍʹÓÃC·ç¸ñÊý¾Ý½á¹¹£¬¼´·ÇÍйܵÄÊý¾Ý½á¹¹£¬¿ÉÒÔÌá¸ßÐÔÄÜ¡£
1 Êý¾Ý½á¹¹µÄ¶¨Òå
¿´ÏÂÃæÀý×Ó£º
unsafe struct A {
public int x;
}
unsafe struct B {
pu ......
Ñ¡ÔñÅÅÐò·¨ÀàËÆÎÒÃÇÈËΪµÄÅÅÐòϰ¹ß£º´ÓÊý¾ÝÖÐÑ¡Ôñ×îСµÄͬµÚÒ»¸öÖµ½»»»£¬ÔÚ´ÓʡϵIJ¿·ÖÖÐÑ¡Ôñ×îСµÄÓëµÚ¶þ¸ö½»»»£¬ÕâÑùÍù¸´ÏÂÈ¥……
Ñ¡ÔñÅÅÐòµÄƽ¾ùʱ¼ä¸´ÔӶȱÈðÅÝÅÅÐòµÄÉÔµÍ:
ͬÑùÊý¾ÝµÄÇé¿öÏ£¬2ÖÖËã·¨µÄÑ»·´ÎÊýÊÇÒ»ÑùµÄ£¬µ«Ñ¡ÔñÅÅÐòÊÇÒ»¶Ô¶àµÄ±È½Ï£¬Ã¿ÌËÖ»½øÐÐ0µ½1´Î½»»»£¬¶øÃ°ÅÝÅÅÐòÊÇÏàÁÚÁ½Á½±È½Ï£ ......
/*
* Exercise 2-5 Page 48
*
* Write the function any(s1,s2), which returns the first location
* in the string s1 where any character from the string s2 occurs,
* or -1 if s1 contains no characters from s2. (The standard library
* function strpbrk does the same job but returns a pointer t ......
source: http://blog.renren.com/blog/229071289/443686923
C/C++ÊÇ×îÖ÷ÒªµÄ±à³ÌÓïÑÔ¡£ÕâÀïÁгöÁË50ÃûÓÅÐãÍøÕ¾ºÍÍøÒ³Çåµ¥£¬ÕâÐ©ÍøÕ¾Ìṩc/c++Ô´´úÂë¡£Õâ·ÝÇåµ¥ÌṩÁËÔ´´úÂëµÄÁ´½ÓÒÔ¼°ËüÃǵÄС˵Ã÷¡£ÎÒÒѾ¡Á¦°üÀ¨×î¼ÑµÄC/C++Ô´´úÂëµÄÍøÕ¾¡£Õâ²»ÊÇÒ»¸öÍêÕûµÄÇåµ¥£¬ÄúÓн¨Òé¿ÉÒÔÁªÏµÎÒ£¬ÎÒ½«»¶ÓÄúµÄ½¨Ò飬ÒÔ½øÒ»²½¼ÓÇ¿Õâ·½Ãæ ......