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

what value is returned to operating system after program execution?

0 Answers  


Explain why C language is procedural?

0 Answers   GE,


What is the scope of an external variable in c?

0 Answers  


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

0 Answers  


Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We Are Student “ Output: "We Are Student"

1 Answers  






Define macros.

0 Answers   Tech Mahindra,


Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ?

8 Answers   Mascot, TCS,


What does 4d mean in c?

0 Answers  


Subtract Two Number Without Using Subtraction Operator

0 Answers  


What is the use of typedef in structure in c?

0 Answers  


What is structure packing in c?

0 Answers  


how to generate sparse matrix in c

3 Answers  


Categories