Advertisement
sujonshekh

ConvertToUppercase

Jul 15th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. char * ConvertToUppercase(char * input)
  4. {
  5.     char output[255];
  6.     int i;
  7.     for(i=0;i<strlen(input);i++)
  8.     {
  9.         output[i] = input[i]-32;
  10.     }
  11.     return output;
  12. }
  13. main() {
  14.  
  15.  
  16.    FILE *fp;
  17.    char buff[255];
  18.  
  19.    fp = fopen("test.txt", "r");
  20.  
  21.  
  22.    fgets(buff, 255, (FILE*)fp);
  23.    printf("3: %s\n", buff );
  24.    fclose(fp);
  25.    printf("%s",ConvertToUppercase(buff));
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement