C语言链表实现冒泡法排序
摘要:功能是:从键盘输入字符以空格隔开 当输入q或者Q时按回车表示输入结束先放出main函数int main(){ MyNode *myNode = (MyNode *)malloc(sizeof(MyNode)); if (NULL == myNode) { retur...
阅读全文
posted @
2014-03-05 23:22
纯洁的坏蛋
阅读(1385)
推荐(0)
C语言实现字符串拷贝 拷贝指定长度字符串 字符串连接
摘要:void mystrcpy(char *target, char *source){ while((*target = *source) != '\0') { source++; target++; }}void mynstrcpy(char *target, char *source, int...
阅读全文
posted @
2013-10-27 20:47
纯洁的坏蛋
阅读(2490)
推荐(0)
C语言实现strlen(char *str)
摘要:#include int mylen(char *str);int main(){ char *str = "haha"; printf("len = %d", mylen(str)); return 0;}int mylen(char *str){ if(str == NULL) return 0...
阅读全文
posted @
2013-05-29 12:18
纯洁的坏蛋
阅读(571)
推荐(0)
有序表查找优化算法
摘要:#include #include int Swquential_Search(int *a, int n, int key){ int i; a[0] = key; i = n; while(a[i] != key) { i--; } return i;}
阅读全文
posted @
2013-04-27 17:45
纯洁的坏蛋
阅读(162)
推荐(0)
c语言栈Stack简单实现
摘要:#include #include #define MAX_SIZE 5typedef struct Stack{ int top; int data[MAX_SIZE];}Stack;Stack* initStack(){ Stack *s = (Stack *)malloc(sizeof(Sta...
阅读全文
posted @
2013-04-26 20:44
纯洁的坏蛋
阅读(589)
推荐(0)
c语言新建双循环链表/遍历
摘要:Node *create(){ DoubLink *list; Node *p, *pNew, *pHead; pHead = (Node *)malloc(sizeof(Node)); pHead->next = NULL; pHead->prior = NULL;//第一个节点 p = pHea...
阅读全文
posted @
2013-04-25 15:15
纯洁的坏蛋
阅读(271)
推荐(0)
c语言版创建单循环链表
摘要:Node *create(){ int n = 20; Node *pNew, *pTail, *pHead; pHead = (Node *)malloc(sizeof(Node)); pHead->next = pHead;//空链表 自己指向自己 pTail = pHead; //pTail...
阅读全文
posted @
2013-04-25 13:51
纯洁的坏蛋
阅读(614)
推荐(0)
C语言单链表创建,插入,删除
摘要:#include #include typedef struct Node{ int data; //数据域 Node *next; //指针域,指向下一个Node节点}Node;Node *create(); //创建一个单链表int deleteFromList(Node *linkList, ...
阅读全文
posted @
2013-04-25 11:43
纯洁的坏蛋
阅读(424)
推荐(0)
C/C++项目中遇到的困难及解决方案收藏
摘要:1.从字符串中提取某个数字char str[] = "level_0.json";int i = -1;sscanf(str, "level_%d.json", &i);cout<<i;
阅读全文
posted @
2013-03-30 17:26
纯洁的坏蛋
阅读(435)
推荐(0)