上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: #include <stdio.h> #include<string.h> #include<stdlib.h> char* encode(char* buf,int line) { int len=strlen(buf); int nlen=len; if(len%line) nlen=len+( 阅读全文
posted @ 2022-01-10 10:55 sunshine_gzw 阅读(42) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<fcntl.h> #include<unistd.h> #include<sys/epoll.h> #include<arpa/inet.h> #include<sys/socket.h> #include<errno.h> #include < 阅读全文
posted @ 2021-04-26 15:01 sunshine_gzw 阅读(55) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;class A{public: A(char* s) :name(s), len(strlen(name.c_str())) {} void dis() { cout << len << endl; } //只跟下面的顺序有 阅读全文
posted @ 2021-03-14 21:40 sunshine_gzw 阅读(56) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<thread> #include<mutex> using namespace std; recursive_mutex re; void task1() { re.lock(); cout << "处理任务1中..." << endl; st 阅读全文
posted @ 2021-03-13 19:41 sunshine_gzw 阅读(2338) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<thread> #include<mutex> using namespace std; mutex mu; void ThreadSource(int i) { mu.lock(); cout << "线程" << i << "开始执行了" 阅读全文
posted @ 2021-03-13 19:39 sunshine_gzw 阅读(1084) 评论(0) 推荐(0) 编辑
摘要: 利用前向声明减少编译时头文件的引入 问题引入: 假设有三个头文件A,B,C,A中起初有一个类且有一个内联函数。 比如: class XTask1 { public: void test1(){} }; 在B中有: #include "A.h" class XTask2 { public: XTask 阅读全文
posted @ 2021-03-05 19:53 sunshine_gzw 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<thread> using namespace std; void func() { cout << "子线程开始了" << endl; cout << "......" << endl; cout << "子线程结束了" << endl; } 阅读全文
posted @ 2021-02-12 18:14 sunshine_gzw 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 效果图: 加载器代码: lbr_start equ 100 SECTION mbr align=16 vstart=0x7c00 mov ax,0 mov ss,ax mov sp,ax mov ax,[cs:phy_base] mov dx,[cs:phy_base+0x02] mov bx,16 阅读全文
posted @ 2021-02-04 00:09 sunshine_gzw 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Makefile Linux环境下的程序员如果不会使用GNU make来构建和管理自己的工程,应该不能算是一个合格的专业程序 员,至少不能称得上是linux程序员。在Linux(unix)环境下使用GNU 的make工具能够比较容易的构建一个属于你 自己的工程,整个工程的编译只需要一个命令就可以完成 阅读全文
posted @ 2021-01-12 21:56 sunshine_gzw 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 当static修饰全局函数时,他的作用在于限制作用域: 有两个源文件: 在a.cpp中: 这两个函数在a.cpp中都是全局的,唯一区别仅在于一个用static修饰了,在源.cpp中: 总结下来就是,static修饰的全局函数只在本源文件中可见,在其他源文件中不可见。如果把static去掉,那么该全局 阅读全文
posted @ 2020-12-20 09:19 sunshine_gzw 阅读(78) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页