-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_getc.c
More file actions
24 lines (20 loc) · 755 Bytes
/
file_getc.c
File metadata and controls
24 lines (20 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
int main(){
FILE *ptr;
// ptr = fopen("getcdemo.txt","r");
// // char c = fgetc(ptr);
// printf("The value of my character in text file is %c\n",fgetc(ptr) );
// printf("The value of my character in text file is %c\n",fgetc(ptr) );
// printf("The value of my character in text file is %c\n",fgetc(ptr) );
// printf("The value of my character in text file is %c\n",fgetc(ptr) );
// printf("The value of my character in text file is %c\n",fgetc(ptr) );
// printf("The value of my character in text file is %c\n",fgetc(ptr) );
// printf("The value of my character in text file is %c\n",fgetc(ptr) );
ptr = fopen("putcdemo.txt","w");
putc('c',ptr);
putc('c',ptr);
putc('c',ptr);
putc('c',ptr);
fclose(ptr);
return 0;
}