exportoutput.cpp

来自「这是校验位打孔重传的源程序」· C++ 代码 · 共 40 行

CPP
40
字号
#include "parameter_sets.h"

int ExportOutputF(struct BasicParaS * ctrl, double * throughPut,double * numOper) 
{

	int i;
	FILE * fpOut = fopen("Output.dat", "w");

	fprintf(fpOut, "This is the statistic data of Output ..\n");
	printf("\n");
	for (i=0; i<59; i++)
		printf("*");
	printf("\n");
	printf("This is the statistic data of Output ..\n");

	if (ctrl->noiseMode == 0) 
	{
		for (i=0; i<ctrl->totalNumFrames; i++) 
		{
			fprintf(fpOut, "When Eb_No is %.2fdB, the throughPut is %E\n", ctrl->Eb_No[i], *(throughPut+i));
			fprintf(fpOut, " the number of operations is %E\n", *(numOper+i));
			printf("When Eb_No is %.2fdB, the throughPut is %E\n", ctrl->Eb_No[i], *(throughPut+i));
			printf( " the number of operations is %E\n", *(numOper+i));
		}
	} 
	else 
	{
		for (i=0; i<ctrl->totalNumFrames; i++) 
		{
			fprintf(fpOut, "When SNR is %.2fdB, the throughPut is %E\n", ctrl->Eb_No[i], *(throughPut+i));
			fprintf(fpOut, " the number of operations is %E\n", *(numOper+i));
			printf("When SNR is %.2fdB, the throughPut is %E\n", ctrl->Eb_No[i], *(throughPut+i));
			printf( " the number of operations is %E\n", *(numOper+i));
		}	
	}

	fclose(fpOut);
	return 0;
}

⌨️ 快捷键说明

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