Check sibling questions

Write statements to place the file fp1:

(i) to beginning of file

(ii) to 25th byte from the beginning

(iii) to 10 bytes behind the current position of file pointer.

(iv) to 25 bytes behind the EOF position

 

Answer:

(i) to beginning of file : fp1.fseek(1)

(ii) to 25th byte from the beginning : fp1.(25,0)

(iii) to 10 bytes behind the current position of the file pointer : fp1.(-10,1)

(iv) to 25 bytes behind the EOF position : fp1.(-25,2)

Introducing your new favourite teacher - Teachoo Black, at only ₹83 per month

CA Maninder Singh's photo - Expert in Practical Accounts, Taxation and Efiling

Made by

CA Maninder Singh

CA Maninder Singh is a Chartered Accountant for the past 12 years. He also provides Accounts Tax GST Training in Delhi, Kerala and online.