C++
xiaodong60606
这个作者很懒,什么都没留下…
展开
-
c++ 动态库和静态库
转自这里 此文转自吴秦先生的C++静态库与动态库。对吴先生此博文只想说,实在是太精彩了! 1. 什么是库 库是写好的现有的,成熟的,可以复用的代码。现实中每个程序都要依赖很多基础的底层库,不可能每个人的代码都从零开始,因此库的存在意义非同寻常。 本质上来说库是一种可执行代码的二进制形式,可以被操作系统载入内存执行。库有两种:静态库(.a、.lib)和动态库(.so、.dll)。转载 2015-07-27 16:01:44 · 380 阅读 · 0 评论 -
linux udp通讯发包最少代码
#ifndef XGT_DEBUG #define XGT_DEBUG #include class XgtDebug { public: XgtDebug(const char *); ~XgtDebug(); private: int m_clientSock; struct sockaddr_in m_server; public: void原创 2015-08-24 12:07:59 · 604 阅读 · 0 评论 -
利用栈实现精制转换c++
#include #include #include #define STACK_INIT_SIZE 100 //存储空间初始分配量 #define STACKINCREMENT 10 //存储空间增量 /*-----------------------------------------------*/ typedef struct//顺序栈的表示 { int *top; i转载 2015-07-30 17:46:07 · 416 阅读 · 0 评论 -
单项链表倒序
struct STU { int a; STU *pNext; }; struct STU *pStufirst = new STU; pStufirst->a = 0; struct STU *pStuCurrent = NULL; pStuCurrent = pStufirst; str原创 2015-08-19 17:24:02 · 346 阅读 · 0 评论 -
c++ 11 thread使用
#include // std::cout #include // std::thread #include std::mutex mtx; void foo() { int i=0; while(i++<100) { mtx.lock(); sleep(3); printf("foo %原创 2015-09-15 14:34:59 · 666 阅读 · 0 评论