initial import
[staff/goc4/2018bti7061.git] / c-7-compilation / examples / autotools / exercise2toupercase.c
1 #include <stdio.h>
2
3 int main(int argc, char* argv[]){
4 if(argc !=2) goto error;
5
6 char* file_name=argv[1];
7
8 FILE *file_pointer;
9 file_pointer = fopen(file_name,"r");
10
11 if(file_pointer == NULL) goto error;
12 char c;
13 while((c=getc(file_pointer)) != EOF){
14 if(c>='a' && c<='z'){
15 c += 'A'-'a';
16 }
17 putchar(c);
18 }
19
20
21 return 0;
22
23
24 error:
25 printf("Usage \n exercise2toupercase <file name>\n");
26
27 }