[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>第一步:写入c代码
#include<stdio.h> int main() { printf("hello world"); return 0; }
<>第二步:按F5运行进行宏定义
cmd /k gcc -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)"
&& CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT
* 按下回车即可出结果
* 选择保存后可以选择一个快捷键,下次直接按下快捷键即可完美运行!
<>第三步:完美运行
<>补充
* 编译:
cmd /k gcc -Wall -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe"
"$(FULL_CURRENT_PATH)" & PAUSE & EXIT
* 运行:
cmd /k "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT
关于脚本行:cmd /k gcc -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe"
"$(FULL_CURRENT_PATH)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" &
PAUSE & EXIT
*
cmd /k是弹出cmd窗口并执行后续指令。&和&&表示连接作用,说明有多行指令合为一行。
*
gcc -o “$(CURRENT_DIRECTORY)$(NAME_PART).exe” “$(FULL_CURRENT_PATH)”
编译生成.exe文件,输出源文件所在目录。注意这里需要有引号,目的是为了在目录及文件名存在空格的情况下也能够正常运行。
*
&& CLS 清屏。&&的意义在于,前面的语句出现错误,将不会执行该句。
*
&& “$(CURRENT_DIRECTORY)$(NAME_PART).exe” 运行刚刚生成的.exe文件。如果先前的编译错误,将不会运行。
*
& PAUSE 暂停,提示”按任意键继续“。这里无论前面有否错误,都将执行。因此我们看到的是编译错误,显示错误信息并暂停的窗口。
*
& EXIT 退出。