7Fermer9
BrunniLe 10/11/2014 à 12:59
Pas besoin des goto hein, des if peuvent faire l'affaire :
BOOL maFonction() {
    FILE *in, *out, *tmp;
    BOOL success = NO;

    if (in = fopen("hello.txt", "r")) {
        if (out = fopen("helloBetter.txt", "w")) {
            if (tmp = fopen(tmpname(), "w")) {
                ...
                success = YES;
                fclose(tmp);
            }
            fclose(out);
        }
        fclose(in);
    }

    if (!success) {
        printf("On a merdouillé quelque part…\n");
    }
    return success;
}