⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zeropad.c

📁 IP04是一个使用Blackfin开源硬件结合Asterisk开源软件建立的IPPBX系统.
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <string.h>int main(int argc, char *argv[]) {    FILE *fin, *fout;    char *buf;    int  n;    int  blocksize;       if (argc != 4) {	printf("usage: %s InputFile PaddedFile BlockSize\n", argv[0]);	exit(1);    }	    fin = fopen(argv[1],"rb");    if (fin == NULL) {	printf("Error opening %s\n", argv[1]);	exit(1);    }        fout = fopen(argv[2],"wb");    if (fout == NULL) {	printf("Error opening %s\n", argv[2]);	exit(1);    }    blocksize = strtol(argv[3], NULL, 0);    if (blocksize < 0) {	printf("Error in blocksize\n");	exit(1);    }    printf("blocksize = %d (0x%0x)\n", blocksize, blocksize);    buf = (char *)malloc(blocksize);    if (buf == NULL) {	printf("Error in blocksize\n");	exit(1);    }    memset(buf, 0, blocksize);    while((n = fread(buf, sizeof(char), blocksize, fin))) {	fwrite(buf, sizeof(char), blocksize, fout);    }    free(buf);    fclose(fin);    fclose(fout);        return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -