这样的.
其中g++.exe为主程序,"F:\1\main.cpp" -o "F:\1\main.exe" -s -I"C:\Dev-C++\include" -I"C:\Dev-C++\include\g++-3" -I"C:\Dev-C++\include" -L"C:\Dev-C++\lib"
为其后继参数
如果启动成功,该函数返回成功标志,否则返回失败标志.
有没有类似的函数?多谢!.
6 个解决方案
#1
system("g++ f:\\1\\main.cpp");
还有别的
等知道的人来吧
还有别的
等知道的人来吧
#2
还有:
int execl( path, arg0, arg1..., argn, NULL );
int execle( path, arg0, arg1..., argn, NULL,
envp );
int execlp( file, arg0, arg1..., argn, NULL );
int execlpe( file, arg0, arg1..., argn, NULL,
envp );
int execv( path, argv );
int execve( path, argv, envp );
int execvp( file, argv );
int execvpe( file, argv, envp );
const char *path; /* file name incl. path */
const char *file; /* file name */
const char *arg0,...,
*argn; /* arguments */
char *const argv[]; /* array of arguments */
char *const envp[]; /* environment strings */
#include <process.h>
int spawnl( mode, path, arg0, arg1..., argn,
NULL );
int spawnle( mode, path, arg0, arg1..., argn,
NULL, envp);
int spawnlp( mode, file, arg0, arg1..., argn,
NULL );
int spawnlpe( mode, file, arg0, arg1..., argn,
NULL, envp);
int spawnv( mode, path, argv );
int spawnve( mode, path, argv, envp );
int spawnvp( mode, file, argv );
int spawnvpe( mode, file, argv, envp );
int mode; /* mode for parent */
const char *path; /* file name incl. path */
const char *file; /* file name */
const char *arg0,...,
*argn; /* arguments */
char *const argv[]; /* array of arguments */
char *const envp[]; /* environment strings */
int execl( path, arg0, arg1..., argn, NULL );
int execle( path, arg0, arg1..., argn, NULL,
envp );
int execlp( file, arg0, arg1..., argn, NULL );
int execlpe( file, arg0, arg1..., argn, NULL,
envp );
int execv( path, argv );
int execve( path, argv, envp );
int execvp( file, argv );
int execvpe( file, argv, envp );
const char *path; /* file name incl. path */
const char *file; /* file name */
const char *arg0,...,
*argn; /* arguments */
char *const argv[]; /* array of arguments */
char *const envp[]; /* environment strings */
#include <process.h>
int spawnl( mode, path, arg0, arg1..., argn,
NULL );
int spawnle( mode, path, arg0, arg1..., argn,
NULL, envp);
int spawnlp( mode, file, arg0, arg1..., argn,
NULL );
int spawnlpe( mode, file, arg0, arg1..., argn,
NULL, envp);
int spawnv( mode, path, argv );
int spawnve( mode, path, argv, envp );
int spawnvp( mode, file, argv );
int spawnvpe( mode, file, argv, envp );
int mode; /* mode for parent */
const char *path; /* file name incl. path */
const char *file; /* file name */
const char *arg0,...,
*argn; /* arguments */
char *const argv[]; /* array of arguments */
char *const envp[]; /* environment strings */
#3
是不是直接调用“process.h”里面的函数就行了 ?
#4
请写出尽可能详细和简练的代码以供小弟分析,谢谢
#5
up
#6
upup
#1
system("g++ f:\\1\\main.cpp");
还有别的
等知道的人来吧
还有别的
等知道的人来吧
#2
还有:
int execl( path, arg0, arg1..., argn, NULL );
int execle( path, arg0, arg1..., argn, NULL,
envp );
int execlp( file, arg0, arg1..., argn, NULL );
int execlpe( file, arg0, arg1..., argn, NULL,
envp );
int execv( path, argv );
int execve( path, argv, envp );
int execvp( file, argv );
int execvpe( file, argv, envp );
const char *path; /* file name incl. path */
const char *file; /* file name */
const char *arg0,...,
*argn; /* arguments */
char *const argv[]; /* array of arguments */
char *const envp[]; /* environment strings */
#include <process.h>
int spawnl( mode, path, arg0, arg1..., argn,
NULL );
int spawnle( mode, path, arg0, arg1..., argn,
NULL, envp);
int spawnlp( mode, file, arg0, arg1..., argn,
NULL );
int spawnlpe( mode, file, arg0, arg1..., argn,
NULL, envp);
int spawnv( mode, path, argv );
int spawnve( mode, path, argv, envp );
int spawnvp( mode, file, argv );
int spawnvpe( mode, file, argv, envp );
int mode; /* mode for parent */
const char *path; /* file name incl. path */
const char *file; /* file name */
const char *arg0,...,
*argn; /* arguments */
char *const argv[]; /* array of arguments */
char *const envp[]; /* environment strings */
int execl( path, arg0, arg1..., argn, NULL );
int execle( path, arg0, arg1..., argn, NULL,
envp );
int execlp( file, arg0, arg1..., argn, NULL );
int execlpe( file, arg0, arg1..., argn, NULL,
envp );
int execv( path, argv );
int execve( path, argv, envp );
int execvp( file, argv );
int execvpe( file, argv, envp );
const char *path; /* file name incl. path */
const char *file; /* file name */
const char *arg0,...,
*argn; /* arguments */
char *const argv[]; /* array of arguments */
char *const envp[]; /* environment strings */
#include <process.h>
int spawnl( mode, path, arg0, arg1..., argn,
NULL );
int spawnle( mode, path, arg0, arg1..., argn,
NULL, envp);
int spawnlp( mode, file, arg0, arg1..., argn,
NULL );
int spawnlpe( mode, file, arg0, arg1..., argn,
NULL, envp);
int spawnv( mode, path, argv );
int spawnve( mode, path, argv, envp );
int spawnvp( mode, file, argv );
int spawnvpe( mode, file, argv, envp );
int mode; /* mode for parent */
const char *path; /* file name incl. path */
const char *file; /* file name */
const char *arg0,...,
*argn; /* arguments */
char *const argv[]; /* array of arguments */
char *const envp[]; /* environment strings */
#3
是不是直接调用“process.h”里面的函数就行了 ?
#4
请写出尽可能详细和简练的代码以供小弟分析,谢谢
#5
up
#6
upup