📄 genbindata.cpp
字号:
///////////////////// GenBinData.cpp ///////////////////////////////
//genBinData() --- generating packed binary bit stream
//
// Input :
// short numOfBytesToGen ----- the number of packed bytes to generate.
//
// Output :
// Int8 *pPackedBinDataOut --- the pointer pointed to the buffer to store
// the generated binary bits in the packed-byte form.
//
/////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <ctime>
#include "typedef.h"
#include "stdio.h"
void genBinData (Uint8* pPackedBinDataOut, short numOfBytesToGen)
{
srand((unsigned) time(NULL));
// FILE *p;
// p =fopen("randin.txt","w+");
for (int i = 0; i < numOfBytesToGen; i++)
// for (int i = 0;i < 239; i++)
{
pPackedBinDataOut[i] = rand()%256;
//if(i%8 == 0) fprintf(p,"\n");
//fprintf(p,"%5d, ",pPackedBinDataOut[i]);
}
//fclose(p);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -