📄 main.cpp
字号:
#include "head.h"
#include "main.h"
#include "parameter.h"
void main(){
int **Hb,**H;
int i,j,NN;
FILE *outfile;
NN=12;
if ((outfile=fopen("parity.txt","w"))==NULL) {
printf("can not open the output file\n");
exit(5);
}
if ((H=(int **)calloc(M*z0,sizeof(int *)))==NULL) {
printf("can not calloc the address\n");
exit(5);
}
for(i=0;i<M*z0;i++){
if ((H[i]=(int *)calloc(H_row,sizeof(int *)))==NULL) {
printf("can not calloc the address\n");
exit(5);
}
}
Hb=initialized();
for(i=0;i<M*z0;i++) //H initialized,store the position of entry 1
for(j=0;j<H_row;j++)
H[i][j]=-1;
ieee(H, Hb); //802.16e H is expanded from Hb
// IRA(H, Hb, NN);
for(i=0;i<M*z0;i++){
for(j=0;j<H_row;j++)
printf("%6d ",H[i][j]);
printf("\n");
}
for(i=0;i<M*z0;i++){
for(j=0;j<H_row;j++)
fprintf(outfile,"%6d ",H[i][j]);
fprintf(outfile,"\n");
}
fclose(outfile);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -