?? list1-3.c
字號:
#include<stdio.h>
#define BUFFER_SIZE 102400
typedef unsigned char byte;
unsigned char buffer[BUFFER_SIZE];
int encode(FILE *fp,byte *img,int mx);
/* mainㄧ計 */
int main(int ac,char *av[])
{
FILE *fp_i,*fp_o;
int i,c;
if (ac<3)
exit(8);
fp_i=fopen(av[1],"rb");
if (fp_i==NULL)
{
fprintf(stderr,"Input File cannot open\n");
exit(8);
}
i=0;
while (i<BUFFER_SIZE && (c=fgetc(fp_i))!=EOF)
{
buffer[i]=c;
i++;
}
fclose(fp_i);
fp_o=fopen(av[2],"wb");
if (fp_o==NULL)
{
fprintf(stderr,"Output File cannot open\n");
exit(8);
}
encode(fp_o,buffer,i);
fclose(fp_o);
return(0);
}
/* ―
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -