CBSE Class 12 Computer Science Question 53 of 136

Data File Handling — Question 18

Back to all questions
18
Question

Question 18

The difference between r+ and w+ modes is expressed as?

  1. No difference
  2. In r+ mode, the pointer is initially placed at the beginning of the file and the pointer is at the end for w+
  3. In w+ mode, the pointer is initially placed at the beginning of the file and the pointer is at the end for r+
  4. Depends on the operating system
Answer

In r+ mode, the pointer is initially placed at the beginning of the file and the pointer is at the end for w+

Reason — In 'r+' mode (read and write), the pointer is initially placed at the beginning of the file. In 'w+' mode (read and write), the pointer is placed at the end of the file.