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

Explain the array representation of a binary tree in C.

0 Answers   Genpact,


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

0 Answers   HP,


c program to print a name without using semicolon

9 Answers   TCS, Wipro,


Write a program to find the biggest number of three numbers in c?

0 Answers  


How can I remove the trailing spaces from a string?

0 Answers   Aspire,






Why is event driven programming or procedural programming, better within specific scenario?

0 Answers   Wipro,


what is the syallabus of computer science students in group- 1?

0 Answers  


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

0 Answers  


#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?

6 Answers  


what is the output of the following program and explain the answer #include<stdio.h> exp() { main(5) } main(int a) { printf("%d",a); return; }

3 Answers   Satyam,


What are the preprocessors?

9 Answers   HP,


What are the different properties of variable number of arguments?

0 Answers  


Categories