会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
chifandeyu
博客园
首页
新随笔
新文章
联系
订阅
管理
上一页
1
2
2017年7月26日
删除单链表节点,时间复杂度为O(1)
摘要: 一个编程练习,删除单链表一个节点,且时间复杂度控制在O(1)内. 1.核心操作代码如下: 2.完整的测试实现代码如下: 头文件 main.cpp 测试可以正常通过.
阅读全文
posted @ 2017-07-26 22:40 chifandeyu
阅读(1112)
评论(0)
推荐(0)
2017年3月20日
匹配URL
摘要: 使用一个不错的正则表达式来配对一个正确的url. string reg = @"(?i)(http://|https://)?(\w+\.){1,3}(com(\.cn)?|cn|net|info|org|us|tk)\b"; 比较通用 string reg = @"(?i)(http://|htt
阅读全文
posted @ 2017-03-20 12:50 chifandeyu
阅读(188)
评论(0)
推荐(0)
2017年2月9日
C#文本框允许使用ctrl+A
摘要: C#文本框中默认是不允许使用全选的。可以通过以下事件完成: private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.A) textBox1.SelectAll(
阅读全文
posted @ 2017-02-09 18:07 chifandeyu
阅读(775)
评论(0)
推荐(0)
2015年12月18日
实现统计一个字符串所含的不同字符的总数
摘要: 1 #include <stdio.h> 2 3 int charCount(char *str) 4 { 5 int iCount = 0; 6 int i, j, k=0; 7 char *p = str; 8 char *q = p; 9 while (*p) 10 { 11 p++; 12
阅读全文
posted @ 2015-12-18 01:01 chifandeyu
阅读(1176)
评论(0)
推荐(0)
2015年11月7日
调用win32 api 函数SendMessage() 实现消息直接调用
摘要: 简单的调用例子, 适合初学者学习,当然 我也是初学者. 1 #include 2 #include 3 #include 4 5 #define dim(x) (sizeof()/sizeof(x[0])) 6 7 int main() 8 { 9 system("color 5b...
阅读全文
posted @ 2015-11-07 19:32 chifandeyu
阅读(1661)
评论(0)
推荐(0)
2015年10月25日
关于C++的const对象
摘要: 对于const类对象,类指针, 类引用, 只能调用类的const成员函数.1.const成员函数不允许被修改它所在对象的任何一个成员变量.2.const成员函数能访问对象的const成员, 而其他成员函数不可以.#include using namespace std;class CTest{pri...
阅读全文
posted @ 2015-10-25 21:19 chifandeyu
阅读(223)
评论(0)
推荐(0)
2015年10月1日
从一个文本文件中找出使用频率最高的五个字符
摘要: 1 #include 2 #define N 95 //可打印字符总数 3 #define space 32 //空格符ASCII码 4 5 int main() 6 { 7 char cNum[N] = {0}, ch; 8 int iNum[N] = {0}; 9 int i, j, k, iMax, tag, h = 5; 10 ...
阅读全文
posted @ 2015-10-01 02:58 chifandeyu
阅读(211)
评论(0)
推荐(0)
2015年9月26日
C++基础中的基础(深拷贝与浅拷贝)
摘要: #include <iostream> #include <string> #include <assert.h> using namespace std; //声明字符串拷贝函数 char* mystrcpy(char* str1,const char* str2); class CPerson
阅读全文
posted @ 2015-09-26 01:43 chifandeyu
阅读(137)
评论(0)
推荐(0)
上一页
1
2