摘要: 使用malloc查看能分配到多大的动态内存: #include<stdio.h>#include<stdlib.h>int main(void){//注意更换环境后,Tab键,标点符号等要检查正确使用 void *p; unsigned int num=0; while((p=malloc(100* 阅读全文
posted @ 2020-03-09 13:09 前方路wx 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stat.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int main(int argc, char **argv) { struct stat bu 阅读全文
posted @ 2020-03-08 19:18 前方路wx 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 终端打印: #include<stdio.h> void main(){ printf("\033[2J\033[6;6H\033[37;42m这是打印内容\n\033[0m"); //#2J为清屏,6,6为设置光标坐标,37,42为前景色(字体色),背景色色码,,字码参数要以m为结尾 // 4m为 阅读全文
posted @ 2020-03-06 20:19 前方路wx 阅读(235) 评论(0) 推荐(0) 编辑
摘要: SSH服务 检查安装了那些:dpkg –l |grep –i ssh #应安装 server 和client(自带) 安装:apt-get install openssh-server 提示解析失败原因:1.中途更换网络,重启解决。 2.改/etc/resolvconf/resolv.conf.d/ 阅读全文
posted @ 2020-03-03 15:38 前方路wx 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1.Linux命令 根目录:/开头的目录 相对目录: ./ (进入同级相对目录)或 ../开头的目录 usr/share/doc 切换到 usr/share/man 命令为 cd ./man- 上一个工作目录 ls #查看当前目录下所有子目录、文件 tree #以树状方式查看目录结构 tree -L 阅读全文
posted @ 2020-02-20 22:23 前方路wx 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 1.终端下连接mysql服务 mysql -uroot -p回车后输入设定的密码即可。 进去后每条命令结尾要带分号;退出命令exit 单行注释有两种:# 或 --空格。多行注释/* */ 2.基本命令集合 针对数据库:use sys; show databases; 查看当前操作的数据库:selec 阅读全文
posted @ 2020-02-18 22:00 前方路wx 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 1.Hello的开始 需安装好iris框架这里命名为demo.go func main() { //app:=iris.New() // //app.Run(iris.Addr(":8000")) app := iris.New() app.Logger().SetLevel("debug") ap 阅读全文
posted @ 2020-02-17 17:08 前方路wx 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1.⻓度为0的数组在内存中并不占⽤空间。空数组虽然很少直接使⽤,但是可以⽤于强调某种特有类型的 操作时避免分配额外的内存空间,⽐如⽤于管道的同步操作:c1 := make(chan [0]int)go func() {fmt.Println("c1")c1 <- [0]int{}}()<-c1 在这 阅读全文
posted @ 2020-02-09 20:11 前方路wx 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1. 在以字符串作为参数传递给fmt.Println函数时,字符串的内容并没有被复制 ——传递的仅仅是字符串的地址和⻓度(字符串的结构在 reflect.StringHeader 中定义)。在Go语⾔ 中,函数参数都是以复制的⽅式(不⽀持以引⽤的⽅式)传递(⽐较特殊的是,Go语⾔闭包函数对外部 变量 阅读全文
posted @ 2020-02-09 13:21 前方路wx 阅读(229) 评论(0) 推荐(0) 编辑