随笔分类 -  C、C++基础

摘要:"c++17 filesystem, regex 遍历目录" cpp include include include include include //linux 精确度s, us gettimeofday() include include include using namespace std 阅读全文
posted @ 2018-09-05 03:29 scott_h 编辑
摘要:"Linux(C/C++)下的文件操作open、fopen与freopen" open是linux下的底层系统调用函数,fopen与freopen c/c++下的标准I/O库函数,带输入/输出缓冲。 linxu下的fopen是open的封装函数,fopen最终还是要调用底层的系统调用open。 所以 阅读全文
posted @ 2018-09-04 19:32 scott_h 阅读(1954) 评论(0) 推荐(0) 编辑
摘要:"Linux时钟精度:毫秒?微妙?纳秒?" 阅读全文
posted @ 2018-09-04 18:07 scott_h 阅读(1242) 评论(0) 推荐(0) 编辑
摘要:linux 遍历目录+文件(优化版本) windows原生API 遍历版本(当年受了不少折磨) c++17 FS 还是挺好用的, VS2017支持,但是linux g++7.3 还是不支持 filesystem #include<filesystem> #include<regex> //正则表达式 阅读全文
posted @ 2018-09-03 23:01 scott_h 阅读(3477) 评论(2) 推荐(0) 编辑
摘要:```cpp std::string data = "This is a sample string."; // convert string to upper case std::for_each(data.begin(), data.end(), "" { c = ::toupper(c); } 阅读全文
posted @ 2018-08-13 22:05 scott_h 阅读(292) 评论(0) 推荐(0) 编辑
摘要:我遇到的情况是c++ stl include include 在stdafx.h 和 .cpp 重复了,所以出现此问题, 所以把依赖全放到一起了。 www.cnblogs.com/A Song/archive/2012/03/23/2413782.html 阅读全文
posted @ 2018-08-09 01:24 scott_h 阅读(486) 评论(0) 推荐(0) 编辑
摘要:http://www.cplusplus.com/reference/sstream/ostringstream/ https://en.cppreference.com/w/cpp/io/basic_stringstream https://www.cnblogs.com/hdk1993/p/58 阅读全文
posted @ 2018-08-08 22:58 scott_h 阅读(1170) 评论(0) 推荐(0) 编辑
摘要:转自:http://blog.csdn.net/hackbuteer1/article/details/7390093 ^: 按位异或;&:按位与; | :按位或 计算机系统中,数值一律用补码来表示:因为补码可以使符号位和数值位统一处理,同时可以使减法按照加法来处理。 对补码做简单介绍:数值编码分为 阅读全文
posted @ 2018-06-10 02:38 scott_h 阅读(2904) 评论(0) 推荐(0) 编辑
摘要:```cpp OutputDebugStringA("begin 1========"); for (int i = 0; i 阅读全文
posted @ 2017-06-22 23:52 scott_h 阅读(755) 评论(0) 推荐(0) 编辑
摘要:来自 "C语言中的 static变量、static函数" 1. static 变量 静态变量的类型 说明符是static。 静态变量当然是属于静态存储方式,但是属于静态存储方式的量不一定就是静态变量。 例如外部变量虽属于静态 存储方式,但不一定是静态变量,必须由 static加以定义... 阅读全文
posted @ 2015-11-25 00:11 scott_h 阅读(612) 评论(0) 推荐(0) 编辑
摘要:http://blog.jobbole.com/82582/ 原文出处: codeproject 译文出处:CodingWu的博客 欢迎分享原创到伯乐头条 阅读全文
posted @ 2015-11-06 22:45 scott_h 阅读(197) 评论(0) 推荐(0) 编辑
摘要:线程不是一定要设置成静态成员。 也可以设置成C方式的 全局函数。 就是一定要 》 存放在 (内存)全局代码区。因为不能随着 对象的构造,析构 而改变生命周期。 http://blog.csdn.net/wangningyu/article/details/7478322 为什么类中的线程函数必须要声 阅读全文
posted @ 2015-10-18 00:48 scott_h 编辑
摘要:github: https://github.com/CppCon/CppCon2015CppCon 2015 Presentation Materialshttps://github.com/CppCon/CppCon2015 is the canonical location for prese... 阅读全文
posted @ 2015-10-05 21:03 scott_h 阅读(464) 评论(0) 推荐(0) 编辑
摘要:STL 一般分为2种: 序列式容器(vector,list,deque,stack,queue,heap,stack,array(c++11)等 。。。) 关联式容器(每个元素都有Key和Value) 内部结构可能是红黑树,或者散列表 set/map multiset/multimap 都是基于红黑 阅读全文
posted @ 2015-07-17 20:19 scott_h 阅读(256) 评论(0) 推荐(0) 编辑
摘要:关联bolgC++ 对象的内存布局(上) C++ 对象的内存布局(下) C++ 虚函数表解析陈皓http://blog.csdn.net/haoel前言C++中 的虚函数的作用主要是实现了多态的机制。关于多态,简而言之就是用父类型别的指针指向其子类的实例,然后通过父类的指针调用实际子类的成员函数。这... 阅读全文
posted @ 2015-04-07 18:40 scott_h 编辑
摘要:一般程序中我们经常 需要 修改 2个形参的内容。 比如 memcpy(dst,src,size) strcpy(dst,src,size) strstr(dst,src,size) 需要把src 的内容 赋值给dst+x ,然后把修改后dst的值,反映到函数外部。 以下就是2种方法,来修改... 阅读全文
posted @ 2014-11-03 15:55 scott_h 阅读(209) 评论(0) 推荐(0) 编辑
摘要:"c++ keyword" http://www.cplusplus.com/ const defines that the type is constant. volatile defines that the type is volatile. mutable applies to non st 阅读全文
posted @ 2014-11-03 12:11 scott_h 编辑
摘要:// searchFile.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <tchar.h> #include <iostream> #include <windo 阅读全文
posted @ 2014-10-23 18:29 scott_h 编辑
摘要:http://www.drdobbs.com/cpp/c-reading-list/240155654?pgno=6中文翻译版 [ C++11标准后的C++阅读书目](http://blog.jobbole.com/47357/)1.C++ Programming Language, 4th Edi... 阅读全文
posted @ 2014-07-14 18:47 scott_h 编辑
摘要:指针 面试题 阅读全文
posted @ 2014-05-02 02:56 scott_h 阅读(570) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示