All pastes #416187 Raw Edit

Untitled

public c v1 · immutable
#416187 ·published 2007-03-30 03:19 UTC
rendered paste body
#include <stdio.h>int main(){        FILE *fp;        char c;        fp = fopen("file1.txt","r");        // Check if it opened        if(!fp){                perror("fopen");        }        else{                // Everything is going swell                while(c = fgetc(fp) != EOF){                        FILE *fp2;                        fp2 = fopen("file2.txt","a");                        if(!fp2){                                perror("fopen");                                break;                        }                        else{                                fputc(fp, c);                        }                        fclose(fp2);                }                fclose(fp);        }}