1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| #include <stdio.h>
#include <stdlib.h>
//const char const mots1[] = "zero\0un\0deux\0trois\0quatre\0";
//const char const * mots2[] = {"zero", "un", "deux", "trois", "quatre"};
static void affiche(const char* s){
puts(s);
}
#define AFFICHE(s) puts((s))
int main(void) {
static const char const lettres[] = "zero\0un\0deux\0trois\0quatre\0";
static const char const * mots[] = {"zero", "un", "deux", "trois", "quatre"};
affiche(lettres + 0);
affiche(lettres + 13);
affiche(&lettres[0]);
affiche(&lettres[13]);
affiche(mots[0]);
affiche(mots[2]);
affiche(*(mots + 0));
affiche(*(mots + 2));
AFFICHE(lettres + 0);
AFFICHE(lettres + 13);
AFFICHE(&lettres[0]);
AFFICHE(&lettres[13]);
AFFICHE(mots[0]);
AFFICHE(mots[2]);
AFFICHE(*(mots + 0));
AFFICHE(*(mots + 2));
return EXIT_SUCCESS;
} |
Partager