Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uwmcsd1!lakesys!davek From: davek@lakesys.UUCP (Dave Kraft) Newsgroups: comp.lang.c Subject: Re: Inversion Summary: Problem solved. Keywords: Inversion, binary, en/decryption, etc. Message-ID: <594@lakesys.UUCP> Date: 3 May 89 01:42:53 GMT References: <593@lakesys.UUCP> Organization: Lake Systems - Milwaukee, Wisconsin Lines: 46 Hi, Aftter a few hours of research, I solved my own problem. I have alos posted the finished product, wich works quite well. If you have any questions, please send them in email. Thanks. /* crypt.c --Encrypts/decrypts files. Works both on Unix/Xenix and * Turbo C 2.0. * Direct mail enquiries to: davek@lakesys.lakesys.com -OR- * uunet!marque!lakesys!davek */ #include main() { char fn1[30],fn2[30],c; int i; FILE *f1,*f2,*fopen(); scanf("%s%s",fn1,fn2); f1 = fopen(fn1,"r"); if(f1 == NULL){ printf("Error opening %s.\n",fn1); exit(1); } f2 = fopen(fn2,"w"); if(f2 == NULL){ printf("Error opening %s.\n",fn2); exit(2); } while(feof(f1) == 0){ c = fgetc(f1); fputc(~c,f2); } fclose(f1); fclose(f2); } I know I could've used argc and argv, but, this was quicker. -- davek@lakesys.lakesys.com -OR- uunet!marque!lakesys!davek ------------------------------------------------------------------------------- "The mystical divinity of unashamed felinity. 'Round the cathedral rang 'Vivat!' Life to the everlasting Cat!" --'Cats'