In article <11*********************@g43g2000cwa.googlegroups. com>,
yezi <ye*****@hotmail.com> wrote:
I have another problem with that. Suppose I systemcall the function is
success, is that mean "inter" and the "end " is running simultaneously
or like the following way :
"end" ->"inter" then "end".
Here is the entire C89 documentation about system()
=== begin documentation ===
4.10.4.5 The system Function
Synopsis:
#include <stdlib.h>
int system(const char *string);
Description:
The system function passes the string pointed to by string to
the host environment to be executed by a command processor in an
implementation-defined manner. A null pointer may be used for
string to inquire whether a command processor exists.
Returns:
If the argument is a null pointer, the system function returns nonzero
only if a command processor is available. If the argument is not
a null pointer, the system function returns an implementation-defined
value.
=== end documentation ===
Looking at this, you can see that what happens is operating-system
specific, not defined by C. In order to know what happens on *your*
operating system, you should consult the documentation for your
operating system, or ask in a newsgroup specific to that operating
system.
The most -common- behaviour is that system() does not return
until the invoked command terminates, but that is not the only
behaviour possible and on many systems the behaviour can be modified
in an operating-system specific manner.
If you are trying to get the called program to execute at the same time
as the calling program, the mechanisms for doing that are operating
system specific, and you should consult elsewhere. In particular,
the mechanisms for Windows are considerably different than those
for Unix-like systems.
--
If you lie to the compiler, it will get its revenge. -- Eric Sosman