#include "header.h" Vector CreateVector(int n) { Vector x; x.n=n; x.fp = (float *) calloc(n,sizeof(float)); return x; } int ReadVector(Vector *x) { //FILE *fin; int i,n; int flag=1; // the defaut value of flag means we can read the vector from the input float tmp; Vector *y; //fin=fopen("x.vec","r"); //fscanf(fin,"%d",&n); flag=scanf("%d",&n); if(flag!=1) return flag; // other values of flag mean either we can't read(finish reading) or read in wrong format y=x; (*y).n=n; (*y).fp = (float *) calloc(n,sizeof(float)); for(i=0;i