Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- int main(int argc, char *argv[]) {
- if(argc != 2){
- printf("Wrong number of arguments!\n");
- exit(EXIT_FAILURE);
- }
- char ch;
- FILE * fp = fopen(argv[1], "r");
- if(fp == NULL) {
- printf("Error opening file!\n");
- exit(EXIT_FAILURE);
- }
- while((ch = fgetc( fp )) != EOF) {
- if(isupper(ch)) {
- ch = ch + 32;
- }
- printf("%c", ch);
- }
- fclose(fp);
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement