can you explain in brief what is "r+" mode in a file... i
know that it si used to read and modify rhe existing
content.... but explalanation about the file pointer in "r+"
mode i wann to know???????????

Answers were Sorted based on User's Feedback



can you explain in brief what is "r+" mode in a file... i know that it si used to read an..

Answer / manoj

Mode Type of file Read Write Create Truncate
"r" text yes no no no
"rb" binary yes no no no
"r+" text yes yes no no
"r+b" binary yes yes no no
"rb+" binary yes yes no no
"w" text no yes yes yes
"wb" binary no yes yes yes
"w+" text yes yes yes yes
"w+b" binary yes yes yes yes
"wb+" binary yes yes yes yes
"a" text no yes yes no
"ab" binary no yes yes no
"a+" text yes yes yes no
"a+b" binary no yes yes no
"ab+" binary no yes yes no

Is This Answer Correct ?    2 Yes 0 No

can you explain in brief what is "r+" mode in a file... i know that it si used to read an..

Answer / abdur rab

When a file is opened with update mode ( '+' as the second
or third character in the mode argument), both input and
output may be performed on the associated stream. However,
writes cannot be followed by reads without an intervening
call to fflush or to a file positioning function (fseek,
fsetpos, or rewind), and reads cannot be followed by writes
without an intervening call to a file positioning function.
Since the file position is altered after read or write.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

Subtract Two Number Without Using Subtraction Operator

0 Answers  


Write a C program to print 1 2 3 ... 100 without using loops?

15 Answers   Hindalco,


what different between c and c++

1 Answers  


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

0 Answers  


Can we use visual studio for c?

0 Answers  






What are the main characteristics of c language describe the structure of ac program?

0 Answers  


what is the difference between global variable & static variable declared out side all the function in the file.

2 Answers  


we have a 3litres jug and a 5 litres jug and no measures on them. using these two jugs how can we measure 4 litres of water?

2 Answers   Convergys,


How can I convert a number to a string?

0 Answers  


write a programme to convert temperature from farenheit to celcius?

4 Answers   IBM,


What are the types of c language?

0 Answers  


what is the stackpointer

2 Answers  


Categories