7Close9
BrunniOn the 2014-11-10 at 12:59pm
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;
}