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 a struct c#?

0 Answers  


What is the process of writing the null pointer?

0 Answers  


Can you define which header file to include at compile time?

0 Answers   Aspire, Infogain,


#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared like DCHAR ch1, ch2; TCHAR ch3, ch4; then what will be types of ch1, ch2, ch3 and ch4?

6 Answers   NDS,


WAP to accept first name,middle name & last name of a student display its initials?

5 Answers   AITH, NIIT,






write a c program to change only the 3rd bit of the particular number such that other bits are not affected.. if bitnum=10(say.. it can be any no..

10 Answers   Bosch, Mind Tree,


Explain the term printf() and scanf() used in c language?

0 Answers  


what is the role you expect in software industry?

2 Answers   HCL, Wipro,


for(;;) printf("C language") What is out put of above??

2 Answers   Practical Viva Questions,


Print the foll in C...eg when n=5 the o/p must b + + + + + + + + + + + + + + + + +

1 Answers  


15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?

2 Answers   CTS,


The variables are int sum=10,SuM=20; these are same or different?

3 Answers  


Categories