Chapter - 13: File Input-Output

While using the statement, fp = fopen ( "myfile.c", "wb" ) ; what happens if,


B
Sections
8
Exercises

A

B

C

1

2

3

4

5

6

7

8

9

- 'myfile.c' does not exist on the disk.
- 'myfile.c' exists on the disk


Ans: 
1. If 'myfile.c' do not exist in the disk, so a new file is created, and fp points to that new file in binary mode.
2. If 'myfile.c' exists on the disk, so fp points to that file in binary mode.


© 2020 Garbage Valuegarbage value logo