How can we open a file in Binary mode and Text mode?what is
the difference?
Answer Posted / 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 View All Answers
What is the role of && operator in a program code?
Why static is used in c?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
what are bit fields in c?
What are formal parameters?
What is meant by operator precedence?
When should a type cast be used?
What are c preprocessors?
how many key words availabel in c a) 28 b) 31 c) 32
Which is better malloc or calloc?
What is 1f in c?
What is signed and unsigned?
how to write a c program to print list of fruits in alpabetical order?
What is the right type to use for boolean values in c? Is there a standard type?
Explain what is the difference between #include and #include 'file' ?