A picture with material!!! C language algorithm of file picture synthesizer

Kailugaji blog Park

http://www.cnblogs.com/kailugaji/

1. Open f disk and find two files first. One is a compressed file (2.rar), the other is a picture (1.jpg). Put it in F disk directory. Of course, other disks can also be used.

1.jpg image is as follows:

2. The contents of rar file are as follows:

2. Open cmd and enter command

C:\Users\lenovo>F:

F:\>copy /b 1.jpg+2.rar Kaluga Gio.jpg

3. Check disk F again, and there is an additional file (kailugaji. jpg)

4. It looks like 1.jpg on the surface, but please change the suffix of "kailugaji. JPG" to "kailugaji. rar". Something magical happened

The contents of kailugaji.rar are as follows:

It is as like as two peas in 2.rar!!!

So, if you want to have the above C language information, please save the following picture with material, it really has material!!!

 

 

C language implementation algorithm:

 1 #include<stdio.h>
 2 #include<stdlib.h>
 3 void main(){
 4     FILE *f_pic,*f_file,*f_finish;
 5     char ch,pic_name[20],file_name[20],finish_name[20];
 6     printf("Please ipunt picture and file name:\n");
 7     printf("picture:");
 8     scanf("%s",pic_name);
 9     printf("file:");
10     scanf("%s",file_name);
11     printf("Born into:");
12     scanf("%s",finish_name);
13 
14     if(!(f_pic=fopen(pic_name,"rb"))){
15         printf("Cannot open the picture %s !",pic_name);
16         return;
17     }
18 
19     if(!(f_file=fopen(file_name,"rb"))){
20         printf("Cannot open the file %s !",file_name);
21         return;
22     }
23 
24     if(!(f_finish=fopen(finish_name,"wb"))){
25         printf("Cannot open the picture %s !",finish_name);
26         return;
27     }
28 
29     while(!(feof(f_pic))){
30         ch=fgetc(f_pic);
31         fputc(ch,f_finish);
32     }
33 
34     fclose(f_pic);
35 
36     while(!(feof(f_file))){
37         ch=fgetc(f_file);
38         fputc(ch,f_finish);
39     }
40 
41     fclose(f_file);
42     fclose(f_finish);
43     system("pause");
44 }

There are two files in the current directory:

Result:

In the current directory, also generate a picture file kailugaji.jpg

Isn't it amazing!!!

Keywords: C

Added by dvwhi on Tue, 31 Mar 2020 15:53:35 +0300