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

📄 makerand.c

📁 压缩文件中是Error Correction Coding - Mathematical Methods and Algorithms(Wiley 2005)作者:(Todd K. Moon )的配
💻 C
字号:
/****************************************  Program: makerand --- make a file of random bytes***  Todd K. Moon*  Date: Dec. 19, 2002****************************************/#include <stdio.h>#include <stdlib.h>main(int argc, char *argv[]){   int nbytes;   char *fname;   FILE *fout;   int i;   unsigned char b;   if(argc==1) {	  printf("Usage: %s size fname\n",argv[0]);	  exit(-1);   }   nbytes = atoi(argv[1]);   fname = argv[2];   fout = fopen(fname,"wb");   for(i = 0; i < nbytes; i++) {	  b = 256*((double)rand()/(double)RAND_MAX);	  fwrite(&b,1,1,fout);   }   fclose(fout);}   /*Local Variables:compile-command:"gcc -o makerand makerand.c"End:*/

⌨️ 快捷键说明

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