- 博客(10)
- 资源 (4)
- 收藏
- 关注
原创 docker 入门学习
docker 入门学习docker 拉取网站Docker - Official Image | Docker Hub1.安装docker1.删除本机dockeryum remove docker*2.下载yum运行时库 sudo yum install -y yum-utils3.设置下载源yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo4.下载dockers
2021-11-28 15:31:05 559
原创 nginx 开发从入门到精通
书籍网页版,PDF书籍版本代码有缺失,阅读困难https://tengine.taobao.org/book/chapter_02.htmlnginx开发从入门到精通
2021-04-16 08:37:36 95
原创 内联汇编
嵌入式汇编基本格式:asm("汇编语句" : 输出寄存器 : 输入寄存器 : 会被修改的寄存器);输出寄存器:表示这段汇编执行完之后,哪些寄存器用于存放输出数据。这些寄存器会分别对应一C语言表达式值或一个内存地址;输入寄存器:表示在开始执行汇编代码时,这里指定的一些寄存器中应存放的输入值,它们也分别对应着一C变量或常数值。会被修改的寄存器:表示你已经对其中列出的寄存器中的值进行了改动,gcc编译器不能再依赖于它原先对这些寄寄存器加载的值。如果必要的话,gcc需要重新加载这些寄存器。———
2021-03-18 17:24:12 186
原创 shell 编程常见问题解决方法
1.unary operator expected此类错误经常发生在 if 语句之后的条件测试语句中比如:if [ $1 -eq 0 ]就会引发 unary operator expected 错误解决方法:用双中括号if [[ $1 -eq 0 ]]这是因为如果变量未被赋值,则变成中括号与0进行比较,编译器不识别此语句,从而报错[ -eq 02.调试shell与其他编程语言,在调试时可以用将某个变量打印出来检查程序是否达到自己预期的目的,通常可以使用 echo 语句打印变量值,
2021-03-05 15:02:52 601
转载 shell脚本报错“syntax error: operand expected (error token is“ 解决方案
原因:回车换行等格式有误使用以下命令打开shell脚本,发现每行末尾都有一个^Mvim -b xxx.sh解决办法:法1:直接使用以下命令修改格式:sed -i ‘s/\r//g’ xxx.sh再次使用vim -b xxx.sh去打开发现^M已消失!法2:使用NotePad++或其他一些编辑器修改格式可参考博文:syntax error near unexpected token $’do\r ———————————————— 版权声明:本文为CSDN博主「枫雨血痕」的原创文章,遵循C
2021-03-04 15:45:02 12755 1
原创 C++ class 初学(4)
技巧知识点类是用户定义的类型,对象是类的实例1.有时候,使符号常量的作用域为类很有用,例如,类声明可能使用字面值30来指定数组的长度,但类中的数据成员只描述对象的形式,并没有创建对象a. 可以在类中声明一个枚举,使一个常量作用于类的作用域,class tom{private: enum {months = 12}; double mon [months];};传统的枚举方法中,两个枚举定义中的枚举量可能发生冲突例如:enum egg {small,medium,big};enum
2020-12-28 17:38:04 120
原创 C++ class 初学(3)
Destructor naming 析构函数Like constructors, destructors have specific naming rules:The destructor must have the same name as the class, preceded by a tilde (~).The destructor can not take arguments.The destructor has no return type析构函数将类中的说用到的资源,动态分配空间,
2020-12-24 11:04:26 100
原创 C++ class 初学(2)
成员函数访问和封装object-oriented programming 面向对象的编程要求我们需要对一些函数进行封装,并将成员变量权限设置为私有,是为了利用黑箱原理,the separation of interface and implementation is extremely useful because it allows us to use objects without understanding how they work. This vastly reduces the complex
2020-12-23 08:19:56 162
原创 C++ class 初学(1)
类 class 和结构体 struct的区别A class defaults its members to private. A struct defaults its members to public.…structs inherit from other classes publicly and classes inherit privately.结构体的成员可以由结构体外的任意函数访问#include <iostream> struct DateStruct{
2020-12-22 08:24:29 209
原创 C++编程易错和错误检查
1.输入错误If the user has entered invalid input, ask the user to enter the input again.#include <iostream>#include <limits>#include <string> int main(){ std::string hello{ "Hello, world!" }; int index; do { st
2020-12-21 09:07:53 751 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人