1

Even in Binary or Text mode it is working(image,document,...). Then what is the real use of these mode and how to use them.

#include<stdio.h>
#include<stdlib.h>
int main()
{
    FILE *fp;
    unsigned char buffer[756396];  
    fp=fopen("ref.jpg","r");    //rb
    if(fp==NULL)
    {
        printf("File not present");
        exit(0);    
    }
    else
        fread(buffer,sizeof(buffer),1,fp);  
    fclose(fp);
    fp=fopen("ref1.jpg","w");  //wb
    if(fp==NULL)
    {
        printf("File can not be created");
        exit(0);    
    }
    else
        fwrite(buffer,sizeof(buffer),1,fq);
    fclose(fp);
    return 0;
}

output

Above code create a copy of an image

I want to know the real time application of where and when to use them.

Sathvik
  • 565
  • 1
  • 7
  • 17
  • 2
    The answer is -> https://qr.ae/TWA98d Reference while reading the blog Image->https://i.stack.imgur.com/e4xm6.jpg – Sathvik Oct 16 '19 at 17:29

0 Answers0