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 is used instead of pointers in java than c?

1 Answers   Vuram,


write a program whose output will be- 1 12 123 1234

10 Answers  


Can we declare function inside main?

0 Answers  


a=(1,2,3); b=1,2,3; c=1,(2,3); d=(1,2),3; what's the value of 'a','b','c','d'

2 Answers  


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

0 Answers  


p*=(++q)++*--p when p=q=1 while(q<=6)

0 Answers   KINPOE,


do u print this format '(((())))'. This brackets is based on user input like 4 or 5 or 6,without using any loop's?

1 Answers   Oracle,


how to find out the inorder successor of a node in a tree??

2 Answers   TCS, Yahoo,


write a c program to print "Welcome" without using semicolon in the whole program ??

15 Answers   Infosys, TCS,


What is use of bit field?

0 Answers  


What is wrong with this declaration?

0 Answers  


What is difference between && and & in c?

0 Answers  


Categories