tongqingliu

保持学习的态度

#

[置顶] 博客搬迁

摘要: 新博客地址: "LTQのBlog" 阅读全文

posted @ 2018-08-14 12:15 tongqingliu 阅读(267) 评论(0) 推荐(0) 编辑

2023年6月23日 #

静态类型和动态类型

摘要: 动态类型:变量的类型是在运行时确定的,变量的类型通常由其所引用的值决定。例如,Python和JavaScript是动态类型的编程语言,你可以在运行时将一个变量赋值为整数,然后将其重新赋值为字符串,而不需要显式地声明其类型。 静态类型:变量的类型在编译时就确定了,不能随意更改。变量的类型需要在声明时显 阅读全文

posted @ 2023-06-23 14:48 tongqingliu 阅读(25) 评论(0) 推荐(0) 编辑

2020年11月6日 #

Unix查看gcc/g++的默认include路径

摘要: `gcc -print-prog-name=cc1` -v `gcc -print-prog-name=cc1plus` -v 或者: gcc -x c -v -E /dev/null gcc -x c++ -v -E /dev/null 阅读全文

posted @ 2020-11-06 12:06 tongqingliu 阅读(274) 评论(0) 推荐(0) 编辑

2020年9月2日 #

VSCode格式化代码快捷键

摘要: Visual Studio Code可以通过以下快捷键格式化代码: On Windows Shift + Alt + F On Mac Shift + Option + F On Ubuntu Ctrl + Shift + I 阅读全文

posted @ 2020-09-02 03:48 tongqingliu 阅读(5604) 评论(0) 推荐(0) 编辑

2020年9月1日 #

C++二叉搜索树

摘要: //BST.h #pragma once template <typename T> class BST; template <typename T> class BSTNode { public: friend class BST<T>; BSTNode() { lChild = rChild = 阅读全文

posted @ 2020-09-01 18:29 tongqingliu 阅读(80) 评论(0) 推荐(0) 编辑

C++实现安全队列

摘要: ```cpp #ifndef SAFEQUEUE #define SAFEQUEUE #include <iostream> #include <queue> #include <thread> #include <mutex> #include <condition_variable> using 阅读全文

posted @ 2020-09-01 18:00 tongqingliu 阅读(176) 评论(0) 推荐(0) 编辑

Go语言使用net库进行远程过程调用

摘要: 文件结构: │ ├─rpc_client │ rpc_client.go │ ├─rpc_protocol │ rpc_protocol.go │ └─rpc_server rpc_server.go 协议 //rpc_protocol.go package RpcProtocol // 算数运算请 阅读全文

posted @ 2020-09-01 11:12 tongqingliu 阅读(260) 评论(0) 推荐(0) 编辑

2020年8月31日 #

深入理解C++中内联inline函数和宏定义的区别

摘要: inline函数是C++引入的机制,目的是解决使用宏定义的一些缺点。 内联函数与宏定义区别 (1)内联函数在编译时展开,宏在预编译时展开; (2)内联函数直接嵌入到目标代码中,宏是简单的做文本替换; (3)内联函数有类型检测、语法判断等功能,宏没有; (4)inline函数是函数,宏不是; (5)宏 阅读全文

posted @ 2020-08-31 18:56 tongqingliu 阅读(786) 评论(0) 推荐(0) 编辑

深入理解C++中的new/delete和malloc/free动态内存管理

摘要: malloc/free和new/delete的区别 malloc/free是C/C标准库的函数;new/delete是C操作符。 malloc/free只是动态分配内存空间/释放空间;new/delete除了分配空间还会调用构造函数和析构函数进行初始化与清理资源。 malloc/free需要手动计算 阅读全文

posted @ 2020-08-31 18:37 tongqingliu 阅读(682) 评论(0) 推荐(0) 编辑

2020年8月26日 #

vscode快速添加文件头部注释和函数注释

摘要: 安装插件并配置 vscode安装koroFileHeader插件,ctrl+shift+p 搜索setting,然后搜索FileHeader点击并且进入setting界面。 添加以下配置项: //快速添加文件头部注释和函数注释 "fileheader.configObj": { "createFil 阅读全文

posted @ 2020-08-26 19:58 tongqingliu 阅读(13852) 评论(1) 推荐(0) 编辑

2020年8月22日 #

golang使用代理下载库

摘要: 使用代理: go env -w GO111MODULE=on go env -w GOPROXY="https://goproxy.io,direct" 调试时使用: go env -w GO111MODULE=off 阅读全文

posted @ 2020-08-22 16:07 tongqingliu 阅读(275) 评论(0) 推荐(0) 编辑

解决centos7的root账户下无法通过code命令启动vscode

摘要: centos7的root账户下无法通过code命令启动vscode: [root@localhost ~]# code You are trying to start vscode as a super user which is not recommended. If you really wan 阅读全文

posted @ 2020-08-22 16:05 tongqingliu 阅读(2696) 评论(0) 推荐(0) 编辑

centos7安装epel

摘要: 安装epel: wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -ivh epel-release-latest-7.noarch.rpm 阅读全文

posted @ 2020-08-22 16:04 tongqingliu 阅读(539) 评论(0) 推荐(0) 编辑

centos7用过yum安装vscode

摘要: sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.mic 阅读全文

posted @ 2020-08-22 16:03 tongqingliu 阅读(1034) 评论(0) 推荐(0) 编辑

yum install gcc报错Error: Package: glibc-2.17-260.el7_6.6.i686 (updates) Requires: glibc-common = 2.17

摘要: yum install gcc 结果报错: [root@localhost ~]# yum install gcc Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * epel: 阅读全文

posted @ 2020-08-22 16:02 tongqingliu 阅读(4983) 评论(0) 推荐(0) 编辑

centos7通过yum从vim7升级到vim8

摘要: #rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm #rpm --import http://mirror.ghettoforge.org/distributions 阅读全文

posted @ 2020-08-22 16:01 tongqingliu 阅读(462) 评论(0) 推荐(0) 编辑

解决VM虚拟机安装centos7无法联网

摘要: vim /etc/sysconfig/network-scripts/ifcfg-ens33 将ONBOOT=no改为ONBOOT=yes,然后重启网卡服务: service network restart 网卡服务重启成功后即可联网,使用ping测试一下: ping www.baidu.com 阅读全文

posted @ 2020-08-22 15:58 tongqingliu 阅读(466) 评论(0) 推荐(0) 编辑

centos7设置开机默认使用root账户登陆

摘要: 使用root账户进入系统: vi /etc/gdm/custom.conf 在[daemon]下写入: AutomaticLoginEnable=True AutomaticLogin=root 重启系统之后可以直接进入root账户。 阅读全文

posted @ 2020-08-22 15:54 tongqingliu 阅读(6674) 评论(0) 推荐(0) 编辑

centos7使用sudo命令提示sudo command not found

摘要: yum -y install sudo 阅读全文

posted @ 2020-08-22 15:52 tongqingliu 阅读(623) 评论(0) 推荐(0) 编辑

2020年8月18日 #

不同编译器下C++基本数据类型的字节长度

摘要: 比特(bit),即一个二进制位 ,例如100011就是6比特; 字节(byte),是计算机中数据类型最基本的单位,8bit组成1byte;1024byte组成1KB。 short(短整型),占2byte即16位,两个字节。 int(整型),占4byte即32位,一个int型数据的长度用4个字节来存储 阅读全文

posted @ 2020-08-18 18:34 tongqingliu 阅读(499) 评论(0) 推荐(0) 编辑

2020年8月15日 #

C++函数模板

摘要: #include<iostream> using namespace std; template <class T> void printArray(const T *array, int count) { for (int i=0; i< count; i++) { cout << array[i 阅读全文

posted @ 2020-08-15 14:27 tongqingliu 阅读(109) 评论(0) 推荐(0) 编辑

导航