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

can i know the source code for reversing a linked list with out using a temporary variable?

6 Answers   Honeywell,


What is the easiest sorting method to use?

0 Answers  


please give me some tips for the selection in TCS.

3 Answers   TCS,


#include<stdio.h> void main() { int a=5,b=6,c; int x=(a<b)+7; int y=(x==7)*9; int z=(c=x+y)*2; printf("%h %h %h",x,y,z); } What is the output? Explain it.

8 Answers   IBM,


What is the advantage of c?

0 Answers  






how to set Nth bit of a variable?

1 Answers  


main() { int i,n=010; int sum=0; for(i=1;i<=n;i++) {s=s+i; } printf("%d",&s); getch(); }

6 Answers  


What does the c in ctime mean?

0 Answers  


what are enumerations in C

0 Answers   TCS,


write an algorithm and a program to count the number of elements in a circularly singly linked list

1 Answers   Ignou,


An array name contains base address of the array. Can we change the base address of the array?

4 Answers   NMIMS, Wipro,


What are the different categories of functions in c?

0 Answers  


Categories