Facebook
From rafia, 1 Month ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 164
  1.  #include<stdio.h>
  2. #include<string.h>
  3.  
  4.  
  5.  
  6.     char ch[100];
  7.  
  8. //Swap swp;
  9.  
  10. FILE *fp1,*fp2;
  11.  
  12. void encryptfile(char  filename[]);
  13.  
  14. int main()
  15. {
  16. char s[1000];
  17.     encryptfile("cse109final.txt");
  18.       FILE *  fp2=fopen("cse109final.txt","r");
  19.       while(fscanf(fp2,"%s",s)!=EOF)
  20.         printf("%s",s);
  21.  
  22.  
  23. }
  24. void encryptfile(char filename[])
  25. {
  26.     int i=0,count;
  27.     char ch1,ch2;
  28.     fp1=fopen(filename,"r");
  29.     if(fp1==NULL)
  30.     {
  31.         printf("Designated file not found...");
  32.        // exit(1);
  33.     }
  34.  
  35.  
  36. //    while(1)
  37. //    {
  38. //        int a=fscanf(fp1,"%c", &swp;.ch[i]);
  39. //        if(a==EOF) break;
  40. //        i++;
  41. //    }
  42. //
  43. //    count=i;
  44. //
  45. //    for(i=0; i<k; i++)
  46.     {
  47.         fprintf(fp2,"%c",ch[i]);
  48.     }
  49.  
  50.     fclose(fp1);
  51.     fclose(fp2);
  52. }