All pastes #335502 Raw Edit

stefys

public text v1 · immutable
·published 2007-02-01 11:12 UTC
rendered paste body
#define FILE1 "fisier1"
#define FILE2 "fisier2"

void checkifvalid (char *user, char *pass)
{
    if (...) printf("%s:%s\n",user,pass);
}

int main (void){

	FILE *f1 = fopen(FILE1,"r"),
    	     *f2;
	char user[128],pass[128];
	if (!f1) { printf("Error opening %s\n", FILE1); exit(-1); }
	if (!f2) { printf("Error opening %s\n", FILE2); exit(-1); }

        while ( fgets(user, sizeof(user)-1, f1) ) {

        	while ( fgets(pass, sizeof(pass)-1, f2) ) {
			checkifvalid(user,pass);
                }

        }
        fclose(f1);
        fclose(f2);

}