在Linux下C++编程(周三晚)
下载环境(Cygwin安装)
Cygwin软件下载地址 1、如果电脑是64位,则选择下载第一个 2、如果电脑是32位,则选择第二个 3、点击setup-x86.exe 安装  4、安装过程中选择阿里云镜像(国内的就行) 5、下一步,下一步,直到这个页面
- 在Devel中有三个,分别是cmake、gcc -g++、gdb(版本均选最新)

 
- 在Editors中有一个nona
6、下一步,直到安装好。
linux下的基础命令& C++程序运行命令
hmod 777 test.exe 编辑权限 ls -ltr 看文件+权限 nano main.c 进入文件编写 g++ -o test main.c 编译 ./test当前文件下运行 less main.c 进入问件编写、(/main查找main所在位置) rm -rf test 删除文件 !g++会把你之前以g++开头的命令行输出来 rm -i test.exe 删除 mv main.c main1.c改名(后面加文件夹,为移动) ./当前 …/上一层 cd -回到上一层目

- nano main.c 进入文件编写

*地址 & 是别名,不占用内存空间 int &m = i; ctrl +k 删除一行 ctrl +x c++中从右往左读 所以 ---- int *p , n; n不是指针 strcpy() 函数
两个示例
 
|