main.c
来自「一个UWB仿真程序包」· C语言 代码 · 共 43 行
C
43 行
#include <stdio.h>#include <stddef.h>#include <stdlib.h>#include <math.h>#include "lfsr.h"#define MATLAB 0int main(int argc, char **argv){ int n; int* S; /* Get command line parameter */ if (argc != 2) { fprintf(stderr,"main: inproper number of arguments, bye!\n"); exit(-1); } n = atoi(argv[1]); fprintf(stderr,"Iterate %d times\n",n); /* Initialize the array for the output */ S = (int *)malloc((size_t)((n*NB)*sizeof(int))); if (!S) { fprintf(stderr,"main: allocation failure, bye!\n"); exit(-1); } /* Call the LFSR */ lfsr(S,n); /* Send the result to standard output */ print_content(S,n); /* Clean up */ free(S); /* Done, say goodbye */ exit(0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?