C语言问题待解决?

来源:百度知道 编辑:UC知道 时间:2024/05/30 23:32:16
/* HELLO.C -- Hello, world */

#include <stdlib.h>
#include <stdio.h>

main(void)
{
printf("About to spawn command.com and run a DOS command\n");
system("D:\Program Files\Tencent\QQ\QQ.exe"); /* <<=路径。记得要用两个\\才可以 */
return 0;
getch(); /* 因为\是转义字符! */
}

在win--tc中运行时提示运行错误

("D:\Program Files\Tencent\QQ\QQ.exe"); /* <<=路径。记得要用两个\\才可以 */
你不是写要用两个\\吗,咋还用一个
("D:\\Program Files\\Tencent\\QQ\\QQ.exe");
return 0;
getch(); /* 因为\是转义字符! */
都已经return了,下面的代码根本执行不到

好神气阿。。居然可以打开应用程序。。
我用dev C++编译是通过的。
#include <stdlib.h>
#include <stdio.h>
main()
{
system("D:\\Wopti\\WoptiUtilities.exe"); /* <<=路径。记得要用两个\\才可以 */ \
return 0;
}
你为什么只用了一个\呢?
不是要转义么?

system("D:\Program Files\Tencent\QQ\QQ.exe");

其中的\要换成\\,(后面的注释不是写了吗?为什么不照办?)

用到了gethc()函数,所以要包含conio.h文件

/* HELLO.C -- Hello, world */

中病毒了阿!!!

楼主,你问的什么问题啊??