init projet
This commit is contained in:
39
tp2/sujet/genprint.c
Normal file
39
tp2/sujet/genprint.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "genprint.h"
|
||||
|
||||
#define xstr(s) str(s) // permet l'expansion d'une macro
|
||||
#define str(s) #s // Ex: scanf("%"xstr(BLABLA)"s",buffer);
|
||||
|
||||
// Initialisation aléatoire de l'élément T[i]
|
||||
void init(type_t t, void *T, int i) {
|
||||
if (T == NULL) {
|
||||
// À compléter
|
||||
}
|
||||
|
||||
// switch (t) {}
|
||||
}
|
||||
|
||||
// Affiche T[i] avec le bon format suivant le type t.
|
||||
void print(type_t t, const void *T, int i) {
|
||||
if (T == NULL) {
|
||||
// À compléter
|
||||
}
|
||||
|
||||
// switch (t) {}
|
||||
}
|
||||
|
||||
// Affiche le contenu du tableau T d'éléments de type t.
|
||||
void print_array(const void *T, type_t t, int nb) {
|
||||
if (T == NULL) {
|
||||
// À compléter
|
||||
}
|
||||
|
||||
printf("\n\n");
|
||||
}
|
||||
|
||||
// Lit un tableau d'éléments depuis un flux.
|
||||
void *read_array(FILE *f, type_t *t, int *nb) {
|
||||
if (f == NULL) {
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user