作者xisland ( )
看板PCman
標題[情報] 如何合併別人的表情符號檔
時間Sat Nov 30 09:56:46 2013
// 此程式可將2個表情符號檔合併成1個
#include <stdio.h>
char buf1[10240];
char buf2[10240];
char buf3[20480];
main(int argc, char **argv)
{
FILE *fus1;
FILE *fus2;
FILE *fus3;
int i,l1,l2,l3;
int *n1;
int *n2;
int *n3;
fus1=fopen(argv[1],"rb");
fus2=fopen(argv[2],"rb");
fus3=fopen(argv[3],"wb");
l1=filelength(fileno(fus1));
l2=filelength(fileno(fus2));
l3=l1+l2-2;
fread(buf1,l1,1,fus1);
fread(buf2,l2,1,fus2);
n1=&buf1[0];
n2=&buf2[0];
n3=&buf3[0];
for (i=0;i<l1;i++)
buf3[i]=buf1[i];
for (i=0;i<l2-2;i++)
buf3[i+l1]=buf2[i+2];
*n3=*n1+*n2;
fwrite(buf3,l3,1,fus3);
fclose(fus1);
fclose(fus2);
fclose(fus3);
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.204.113.242