随笔分类 -  C/C++

摘要:一、把QQ群的聊天记录txt格式导出 消息管理器 -> 选择要导出的群 -> 右击、导出 这里要注意 : 导出之后的 文本是 unicode 编码的,需要转换 ==|| 之前不知道,搞了大半天。 重新建一个txt , 把原来的 txt 内容 复制 到 新的 txt ,保存就行了。 二、详细代码 1. 阅读全文
posted @ 2015-03-26 18:54 小爷 阅读(2018) 评论(0) 推荐(0)
摘要:原文:http://www.cppblog.com/mysileng/archive/2012/12/25/196615.html引子:怎么对容器中的所有对象都进行同一个操作?我们可能首先想到的是用循环来实现。比如有如下的一个类:class ClxECS{public: int DoSomethin... 阅读全文
posted @ 2015-03-25 09:58 小爷 阅读(659) 评论(0) 推荐(0)
摘要:原文:http://bbs.ednchina.com/BLOG_ARTICLE_251752.HTM时常在cpp的代码之中看到这样的代码:#ifdef__cplusplus extern "C" { #endif //一段代码#ifdef__cplusplus }#endif 这样的代码到底是什么... 阅读全文
posted @ 2015-03-21 16:55 小爷 阅读(248) 评论(0) 推荐(0)
摘要:1 #include 2 int getbit( int a,int i) 3 { 4 return a&(1 if(n&1 == 0) n/=pow(2,x) ----> n >>= x n*=pow(2,x) ----> n <<= x|或(或1为1) 阅读全文
posted @ 2015-01-29 07:42 小爷 阅读(250) 评论(0) 推荐(0)
摘要:头文件 1 #ifndef __SIMS__ 2 #define __SIMS__ 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #define PWD_LEN 10 10 #define ... 阅读全文
posted @ 2015-01-21 23:33 小爷 阅读(1701) 评论(0) 推荐(0)
摘要:今天看了两章C语言,于是乎编段程序复习下。 还是不清楚这些神奇的东西的到底要干嘛用。。。 敲完后,显得这段代码高大上 但是,想实现这个程序,需要这么写的复杂吗?==|| #include <stdio.h> #include <math.h> #include <stdlib.h> #include 阅读全文
posted @ 2015-01-18 14:21 小爷 阅读(220) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 using namespace std; 4 5 struct cha 6 { 7 char aa[50];//存储单词(不重复) 8 int num;//该单词出现的次数 9 int Mark[1... 阅读全文
posted @ 2015-01-17 10:22 小爷 阅读(347) 评论(0) 推荐(0)