#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>

int
main(int argc, char *argv[])
{
        char outstr[200];
        time_t t;
        struct tm *tmp;
        int i;

        setlocale(LC_TIME, "fr_FR.utf8");
        printf("Affichage des mois en fran��ais��:\n");

        t = time(NULL);
        tmp = localtime(&t);
        if (tmp == NULL) {
                perror("localtime");
                exit(EXIT_FAILURE);
        }

        for (i=0; i<12; i++) {
                tmp->tm_mon = i;
                if (strftime(outstr, sizeof(outstr), "%b", tmp) == 0) {
                        fprintf(stderr, "strftime returned 0");
                        exit(EXIT_FAILURE);
                }
                
                printf("  %s\n", outstr);
        }
        exit(EXIT_SUCCESS);
}

