摘要: int power(int x) { return x * x; } int main() { int x = power(2); //cout << v.str[0] << endl; return 0; } 对于返回值比较偏小的函数,直接将返回值保存至寄存器。 这里先将x的值保存至eax中,在用 阅读全文
posted @ 2020-04-27 21:29 wa小怪兽 阅读(1171) 评论(0) 推荐(0) 编辑
摘要: 对于std::list,最基本的遍历方式可能是这样的: list<int> l = { 0,1,2,3,4 }; for (list<int>::iterator it = l.begin(); it != l.end(); i++) { cout << *it << endl; } std::li 阅读全文
posted @ 2020-04-25 19:16 wa小怪兽 阅读(680) 评论(0) 推荐(0) 编辑
摘要: 记录一下这几个容易混淆的概念。 可移动构造(MoveConstructible) 指定该类型的实例可以从一个右值实参构造 定义 给定: T类型的右值表达式rv 任意标识符 u 下列表达式必须合法且拥有指定的效果: T u = rv; //u 的值等于 rv 在初始化前的值。rv 的新值未指明。T(r 阅读全文
posted @ 2020-04-19 11:52 wa小怪兽 阅读(346) 评论(0) 推荐(0) 编辑
摘要: lamada表达式的语法 [capture](parameters)->return-type {body} demo: #include <iostream>#include <functional>​using namespace std;​void fun(function<int(int, 阅读全文
posted @ 2020-03-26 09:55 wa小怪兽 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <time.h> 3 4 using namespace std; 5 6 char buf1[10010] = { 0 }; 7 char buf2[10020] = { 0 }; 8 9 void *myMemcpy(void * 阅读全文
posted @ 2020-03-26 09:53 wa小怪兽 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 把自己的项目部署到阿里云ecs服务器之后,只有127.0.0.1才能连接到服务器端,检查了阿里云安全组规则,以及socket绑定的地址无误后,发现没有开启服务器防火墙的对应端口。 firewall-cmd --add-port=[端口号]/tcp --permanent firewall-cmd - 阅读全文
posted @ 2019-12-04 13:23 wa小怪兽 阅读(1403) 评论(0) 推荐(0) 编辑
摘要: SockClient.h #pragma once #include<functional> #define _WINDOWS #ifdef _WINDOWS #define _WINSOCK_DEPRECATED_NO_WARNINGS #ifndef _WINSOCK2_H #include<W 阅读全文
posted @ 2019-11-06 15:18 wa小怪兽 阅读(220) 评论(0) 推荐(0) 编辑
摘要: #pragma once #ifndef WINSOCK2_H #define _WINSOCK_DEPRECATED_NO_WARNINGS #include<WinSock2.h> #include<Windows.h> #pragma comment(lib, "ws2_32.lib") #e 阅读全文
posted @ 2019-10-08 16:28 wa小怪兽 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 太累了,,有时间再补解释 阅读全文
posted @ 2019-09-21 19:46 wa小怪兽 阅读(1251) 评论(0) 推荐(0) 编辑
摘要: 参考:https://blog.csdn.net/Dacc123/article/details/79771299 省略了一些头文件 阅读全文
posted @ 2018-12-04 20:27 wa小怪兽 阅读(284) 评论(0) 推荐(0) 编辑