22 lines
603 B
C
Executable File
22 lines
603 B
C
Executable File
/**************************************/
|
|
/* demo_base : demonstration basique */
|
|
/**************************************/
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
#include <assert.h>
|
|
|
|
int main (int argc, char* argv[], char* envp[])
|
|
// argc = compteur d'arguments
|
|
// argv et envp = tableau de pointeurs de chaines
|
|
{
|
|
if (argc != 2){
|
|
fprintf(stdout, "\nSyntaxe : %s nom-de-variable\n\n", argv[0]);
|
|
exit (1);
|
|
}
|
|
printf ("\nProcessus %d (pere : %d) - 2eme mot ='%s'\n", getpid (), getppid (),
|
|
getenv(argv[1]));
|
|
return 0;
|
|
}
|