Guest User

Untitled

a guest
Nov 23rd, 2013
251
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <ctype.h>
  2. #include <stdio.h>
  3.  
  4.  
  5. #define MAX_PATH 6
  6.  
  7. void Load(char name[MAX_PATH])
  8. {
  9. int i;
  10. FILE *aFile;
  11. aFile=fopen("mojplik.txt","r");
  12.  
  13. for(i=0;i<MAX_PATH;i++)
  14. {
  15. fscanf(aFile,"%c",&name[i]);
  16. }
  17. }
  18.  
  19. void Uppercase(char name[MAX_PATH])
  20. {
  21. int i;
  22. for (i = 0; i<MAX_PATH; i++)
  23. name[i]=toupper(name[i]);
  24. }
  25.  
  26. void Lowercase(char name[MAX_PATH])
  27. {
  28. int i;
  29. for (i = 0; i<MAX_PATH; i++)
  30. name[i]=tolower(name[i]);
  31. }
  32.  
  33. void Record(char name[MAX_PATH])
  34. {
  35. int i;
  36. FILE *aFile;
  37. aFile=fopen("WL_mojplik.txt","w");
  38.  
  39. for (i=0;i<MAX_PATH;i++)
  40. fprintf(aFile,"%c",name[i]);
  41. }
  42.  
  43. void Record2(char name[MAX_PATH])
  44. {
  45. int i;
  46. FILE *aFile;
  47. aFile=fopen("ML_mojplik.txt","w");
  48.  
  49. for (i=0;i<MAX_PATH;i++)
  50. fprintf(aFile,"%c",name[i]);
  51. }
  52.  
  53. int main()
  54. {
  55. char Filename[MAX_PATH], uppername[MAX_PATH],lowername[MAX_PATH];
  56.  
  57.  
  58. Load(Filename);
  59. Uppercase(Filename);
  60. Record(Filename);
  61. Load(uppername);
  62. Lowercase(uppername);
  63. Record2(uppername);
  64. printf("\nGotowe!\n");
  65. return 0;
  66. }
RAW Paste Data