Skip to content
Snippets Groups Projects
Commit b3637712 authored by y.dai's avatar y.dai
Browse files

Merge pour renouveler

parents d01822ac 48247673
No related merge requests found
obj = alea.o io.o main.o tri.o
cc = gcc
cflag = -Wall
main : $(obj)
$(cc) $(cflag) $(obj) -o main
main.o : main.c alea.h io.h tableau.h tri.h
$(cc) $(cflag) -c main.c
alea.o : alea.c alea.h tableau.h
$(cc) $(cflag) -c alea.c
io.o : io.c io.h tableau.h
$(cc) $(cflag) -c io.c
tri.o : tri.c tri.h tableau.h
$(cc) $(cflag) -c tri.c
clean:
rm *.o main
#ifndef __ALEA_H__
#define __ALEA_H__
#include <stdlib.h> #include <stdlib.h>
#include "tableau.h" #include "tableau.h"
...@@ -8,3 +10,5 @@ int alea (int m); ...@@ -8,3 +10,5 @@ int alea (int m);
// remplit t avec des valeurs aléatoires // remplit t avec des valeurs aléatoires
void remplir (int m); void remplir (int m);
#endif
#ifndef __IO_H__
#define __IO_H__
#include <stdio.h> #include <stdio.h>
#include "tableau.h" #include "tableau.h"
...@@ -5,3 +7,5 @@ extern tableau t ; ...@@ -5,3 +7,5 @@ extern tableau t ;
// affiche le tableau // affiche le tableau
void affiche(); void affiche();
#endif
#ifndef __TABLEAU_H__
#define __TABLEAU_H__
typedef struct { typedef struct {
int* valeurs ; int* valeurs ;
int taille ; int taille ;
} tableau ; } tableau ;
#endif
#ifndef __TRI_H__
#define __TRI_H__
#include <stdio.h> #include <stdio.h>
#include "tableau.h" #include "tableau.h"
...@@ -8,3 +10,5 @@ void bulle (int k) ; ...@@ -8,3 +10,5 @@ void bulle (int k) ;
// tri (décroissant) du tableau t par la méthode du tri à bulle // tri (décroissant) du tableau t par la méthode du tri à bulle
void trier (); void trier ();
#endif
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment