![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
文章平均质量分 77
kings988
这个作者很懒,什么都没留下…
展开
-
二分查找(折半查找)与冒泡排序(C语言)
#include #include //冒泡排序void sort(int arr[], int len){ int i,j; for(i=0; i<len; i++) { for(j=0; j<len-i-1; j++) { if(arr[j]>arr[j+1]) { int temp; temp = arr[j];原创 2010-01-29 17:10:00 · 2623 阅读 · 0 评论 -
带表头的单向链表实现(C语言)
带表头的单向链表实现(C语言)在vs 2008上测试编译并成功执行 头文件linkedlist.h #ifndef _LINKEDLIST_H#define _LINKEDLIST_H typedef int DataType; typedef struct Node { DataType data; struct Node *next; }Nod原创 2010-01-30 13:55:00 · 938 阅读 · 0 评论 -
C++模板自学实例
头文件mytemplate.h: #ifndef _MYTEMPLATE_H#define _MYTEMPLATE_H template class Person { T1 name; T2 age; public: Person(const T1 name, const T2 age); void show() const; };原创 2010-01-30 17:22:00 · 569 阅读 · 0 评论 -
Essential C++ 学习笔记之静态局部变量
#include #include using namespace std;const vector* fibon_seq( int size ) { const int max_size = 1024; /* 定义elems为fibon_seq()静态局部变量,与非 静态局部变量不同,静态局部变量在函数每次调用 中不会被释放或重原创 2010-02-23 16:25:00 · 632 阅读 · 0 评论 -
使用C操作MySQL数据库(vs 2008)
最近几天闲来无事,便尝试了一下用C操作数据库,下面便是我测试的具体结果:开发环境是windows 7 ultimate(英文版) IDE 是vs 2008 professional 中文版,数据库是mysql 5.1 首先,我在MySQL库中创建了一个test表:CREATE TABLE `test` ( `id` int(11) NOT NULL AUTO_INCREMENT,原创 2009-12-30 09:49:00 · 1198 阅读 · 0 评论