@ -1,3 +1,10 @@
打开自行练习环境
cd /data/woorkspace/myshixun/case1/ //切换目录至代码文件目录
ls //查看目录列表文件
vim hellothread.cpp //按i进行修改操作 按esc退出修改操作 若要保存并退出 esc退出编辑模式后 :或/或? 命令提示符+wq或x q不保存退出
g++ -pthread hellothread.cpp -o daling_123.out //-o 重命名否则默认为a.out -pthread引入函数库文件
./daling_123.out //执行.out可执行文件
(若是无限循环,使用Ctrl+C退出);
实验1.2
#include <stdio.h>
#include <stdlib.h>//for exit()