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);