How can we open a file in Binary mode and Text mode?what is
the difference?



How can we open a file in Binary mode and Text mode?what is the difference?..

Answer / sha

fopen("file1.txt","wb"); will open the file file1.txt in
binary read and write mode. Binary mode is useful to write
a file with 0s and 1s. For example, sometimes it would be
required to open a executable file. In that case, binary
mode is useful.
fopen("file1.txt","w"); will open the file1.txt in text
mode which means you can write regular letters and numbers
in that file.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

what are the advantage and disadvantage of recursion

5 Answers  


What is the acronym for ansi?

0 Answers  


Is c still used?

0 Answers  


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

0 Answers   Wilco,


what is the use of using linked list and array?

10 Answers   Infosys, TCS,


what is difference between strcmp & palindrome?

3 Answers  


Is swift based on c?

0 Answers  


Explain what is the advantage of a random access file?

0 Answers  


Can you write the algorithm for Queue?

0 Answers   College School Exams Tests, TCS,


How do I determine whether a character is numeric, alphabetic, and so on?

0 Answers  


When is a void pointer used?

0 Answers  


what is the disadvantage of using macros?

1 Answers   Wipro,


Categories