03 2016 档案

摘要:http://blog.csdn.net/w2654189525 阅读全文
posted @ 2016-03-14 07:37 iucforever 阅读(138) 评论(0) 推荐(0)
摘要:原因:就是recv函数的第一个参数不是可用的,也就是第一个参数不是建立连接时返回的文件描述符.解决方法:xxx 阅读全文
posted @ 2016-03-13 10:31 iucforever 阅读(2724) 评论(0) 推荐(0)
摘要:#include #include using namespace std;int main(){ string str; str.append("name-"); str.append("wangkaixun-"); str.append("id-"); ... 阅读全文
posted @ 2016-03-12 21:59 iucforever 阅读(536) 评论(0) 推荐(0)
摘要:在某些情况下需要对输入的字符串进行处理,提取其中的需要的信息. 比如在linux中输入”mkdir test”,新建test文件夹,就需要提取其中的test字符. 提取的方法需要boost库中的函数,提取代码如下:#include #include #include #includ... 阅读全文
posted @ 2016-03-12 17:48 iucforever 阅读(2569) 评论(0) 推荐(0)
摘要:之所以要对fgets自动添加的字符进行处理的原因之一是:当你想比较输入的字符时,你会发现输入的字符和源码用来进行对比的字符一模一样,但是使用strcmp比较时就是不一样,原因就是fgets对输入字符添加了一个字–符造成的.怎么造成的呢?strcmp会比较这个字符串所有的内容,长度都... 阅读全文
posted @ 2016-03-12 11:06 iucforever 阅读(1220) 评论(0) 推荐(0)
摘要:最近写代码经常使用字符串,对于输入函数fgets网上有人说输入结束会在末尾自动添加’\n’,还有人说添加的是’\n’,我决定亲自验证:#include "iostream"#include "stdio.h"#include "stdio_ext.h"#include "stdli... 阅读全文
posted @ 2016-03-12 10:35 iucforever 阅读(3329) 评论(2) 推荐(1)
摘要:#include "iostream"#include "stdio.h"#include "stdio_ext.h"#include "stdlib.h"#include "string.h"using namespace std;int main(int argc, char ... 阅读全文
posted @ 2016-03-12 10:12 iucforever 阅读(1582) 评论(0) 推荐(0)