首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

C语言字符串连接有关问题

2012-02-14 
C语言字符串连接问题现在需要使用system()函数例如:char a[100] Shoudown.exe -s -t int ascanf(%d

C语言字符串连接问题
现在需要使用system()函数

例如:
char a[100] = "Shoudown.exe -s -t ";
int a;
scanf("%d",&a);//输出定时关机设置时间
............
system(a);

最后实现例如system("Shoudown.exe -s -t 3600");
需要用C语言实现

[解决办法]
sprintf
strcat
[解决办法]

C/C++ code
char a[100];int t;scanf("%d",&t);//输出定时关机设置时间sprintf(a,"%s %d","Shoudown.exe -s -t " ,t);system(a); 

热点排行