关于system 用法
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
int main()
{
char fileName[] = "C:\\Documents and Settings\\x_wangx\\Desktop\\6631757\\StudentManagement.exe";
int error = 0;
error = system( fileName );
return 0;
}
system 错误返回值1
请教哪里错了
[解决办法]
路径里有空格吧,试着用\"括起来
[解决办法]
- C/C++ code
char fileName[] = "\"C:\\Documents and Settings\\x_wangx\\Desktop\\6631757\\StudentManagement.exe\"";
[解决办法]
Documents and Settings 有空格,你要考虑它得放在引号里面
[解决办法]
路径有空格、会当成多个参数、用 \" filepath \"