"loudking" <lo******@gmail.comha scritto nel messaggio
news:11**********************@e65g2000hsc.googlegr oups.com...
Question : write a program which creates 5 processes (in addition to
itself). One of these processes must display 1, another must display 2
... the last one displays 5. The parent process waits until all other
processes are finished, then returned.
The thing closest to a portable C way to do that, is displaying argv[1][0]
and flushing stdout if argv[1] is not NULL, and writing some code to copy
argv[0] to a string, append " 1" to it, pass it to system() etc. if argv[1]
is NULL.
But nothing in the Standard requires this to work. The behaviour of system()
and the exact contents of argv[0] are implementation defined.