#include "header.h" vec createv(int n) { vec x; x.n=n; x.fp = (float *) calloc(n,sizeof(float)); return x; } int readv(vec *x) { int i,n; int flag=1; //the flag is used to decide if we continue to read vector from file, default set to 1 means the program will read vector at the first time. float tmp; vec *y; flag=scanf("%d",&n);//value of flag shows if the scaning succeed or not. if(flag!=1) return flag; y=x; (*y).n=n; (*y).fp = (float *) calloc(n,sizeof(float)); for(i=0;i