genbindata.cpp
来自「在vc上做的802.16d ofdm phy的仿真」· C++ 代码 · 共 36 行
CPP
36 行
///////////////////// 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 + =
减小字号Ctrl + -
显示快捷键?