应该使用sprintf先格式化到一个字符串数组中,然后传入system。比如:#include<stdio.h>int main(){int seconds;
scanf("%d",&seconds);
char chars[100];
sprintf(chars,"shutdown -s -t %d",seconds);
system(chars);}
system带参数
最新推荐文章于 2023-10-16 10:08:40 发布
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印

1734

被折叠的 条评论
为什么被折叠?



