随笔分类 - c++
摘要:int a; //转换的目标变量。 char c = '7'; //要转换的字符。 a = c - '0'; out a = 7
阅读全文
摘要:安装: sudo apt-get install valgrind valgrind-dbg 使用教程: https://blog.csdn.net/tissar/article/details/87194737
阅读全文
摘要:([1-9]\d*\.?\d*)|(0\.\d*[1-9]) | 符号 | 意义 | | | | | ^ | 匹配行的开头 | | $ | 匹配行的结尾 | | . | 匹配任意单个字符 | | […] | 匹配[]中的任意一个字符 | | (…) | 设定分组 | | \ | 转义字符 | | \
阅读全文
摘要:1、C/C++:long int与long long的区别 在实际的使用中,long与int几乎没有区别:原因是早期的C编译器定义了long int占用4个字节,int占用2个字节,long int是名副其实的长整型。在ANSI C的标准中,对长整型的定义也是long int应该至少和int一样长,
阅读全文
摘要:1、概述 最近在做c++的客户端,调研了一圈选了libhv libhv是c++编写HTTP API 服务端/客户端最简单的库,没有之一 具有如下特性: 跨平台(Windows, Linux, Mac) 支持https 支持RESTful API 支持application/json、applicat
阅读全文
摘要:#include <iostream> #include <iomanip> #include <vector> #include <numeric> #include <chrono> volatile int sink; int main() { std::cout << std::fixed
阅读全文
摘要:C++获取本机IP地址 /* *功能:传入一个网口名,获取相应的IP地址 * */ #include <stdio.h> #include <ifaddrs.h> #include <netinet/in.h> #include <string.h> #include <arpa/inet.h> s
阅读全文
摘要:(\d{1,3}\.){3}\d{1,3} 在c++字符串中需要加\来表示转义
阅读全文
摘要:gst-launch-1.0 playbin uri=rtsp://172.17.0.8/1.264 如果拉的视频流分辨率太大,会出现无法关掉的现象
阅读全文
摘要:在C++中, char* p = "abc"; // valid in C, invalid in C++ 会跳出警告:warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 改成下面会通过
阅读全文