g++/git/vim相关学习笔记

multirotor


The first day ——12.10

  • install vmware-workstation and ubuntu

  • swap sources and 换输入法

  • learn git

  • github关联远程仓库

  • install and use Typora

Git

codemeaning
mkdir test创建目录
cd test进入目录
git init初始化仓库
ls ;ls -ah查看目录
touch test.c新建项目
add添加到缓存
commit -m “words”提交到库
log提交历史
status查看仓库状态
checkout – file回到最近修改状态
rm ;rm -rf file删除
reset+checkout恢复文件
checkout -b dev创建分支+切换
merge合并
branch -a查看分支
branch -D删除分支
branch -m修改分支名
clone远程仓库关联到本地
push origin branch修改提交

The second day——12.11

1. install and learn g++

  • question1: unable to install g++
  • sovle1:swap sources;

2. c++ printf “hello world”

  • question2:unable to edit helloworld.cpp

  • sovle2:learn vim

  • question3:unable to compile and run

  • sovle3:learn g++ about linking cpp files

G++

some command:
commandmeaning
-o outputfile file.cpp编译为可执行文件
-c编译为对象文件
-o outputfile file1.o file2.o链接对象文件
about .o files and .exe files:

对象文件和可执行文件的主要区别在于链接的程度:对象文件包含了部分链接的代码,而可执行文件包含了完全链接的代码。在一些大型项目中,源代码可能被分割成多个文件,然后分别编译成对象文件,最后再链接成一个可执行文件。这样的做法可以提高编译的效率,因为当某个源文件被修改时,只需要重新编译那个文件,而不需要重新编译整个项目。

g++ -o test1 hello.cpp helloworld.cpp
g++ -c hello.cpp
g++ -c helloworld.cpp
g++ -o test2 hello.o helloworld.o
g++ -o test3 hello.o helloworld.cpp
g++ -o test4 hello.cpp //wrong

vim

默认命令模式

commandmeaning
ESC命令模式
gg / G/ 5+G首行/末行/第五行
yy / p/ dd复制/粘贴/剪切
u / ctrl + r撤销/取消撤销
+i / +a编辑模式
:/ wq/ q!末行模式/保存退出/强制退出
  • 34
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值