39 lines
1000 B
C
39 lines
1000 B
C
|
///********************************************************************/
|
||
|
///* IUT NICE-COTE D'AZUR - Departement INFORMATIQUE - R. CHIGNOLI */
|
||
|
///* Module DUT M311 Theme PTHREADS */
|
||
|
///********************************************************************/
|
||
|
/// pthread10.c : squelette pour creation de trois threads
|
||
|
/// Cf enonce ...
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <unistd.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <assert.h>
|
||
|
|
||
|
typedef struct { int nombre; char car;} struct_p;
|
||
|
|
||
|
void imprimer (struct_p* param){
|
||
|
int i;
|
||
|
for (i=0 ; i < param->nombre; i++) printf ("%c", param->car); }
|
||
|
|
||
|
int main (int argc, char* argv[]) {
|
||
|
int i, valeur;
|
||
|
struct_p x;
|
||
|
char tab[3] = {'/', '*', '='};
|
||
|
|
||
|
assert (argc == 2);
|
||
|
valeur = atoi (argv[1]);
|
||
|
for (i=1; i<=3; i++) {
|
||
|
printf ("\nMAIN : Tour de boucle nO %d\n", i);
|
||
|
/// A VOUS DE JOUER
|
||
|
/// Creation des trois threads d'affichage ...
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|