In Binary mode of data file, the opening mode of text mode file is appended by a character ‘b’ i.e. “r” is replace by “rb” “w” is replace by “wb” “a“ is replace by “ab” “r+” is replace by “r+b” “w+” is replace by “w+b” “a+” is replaced by “a+b” The default mode is text mode. Thus when simple “r” is written as mode of opening, this is assumed as text mode. We can write “rt” in place of “r” and so on in the case of text of file. The syntax for all above mode in the case of binary mode is similar to the previous one i.e. text mode like this fptr=fopen(“data.txt”,”rb”);
Learn something about IT