^DX^
public c v1 · immutablevector_t file_sum(const char *filename) { //Open the file. FILE *fp; fp=fopen(filename,"r"); //Make a vector for which we will hold the sum vector_t vecsum; char *line = NULL; line = (char*)malloc(101*sizeof(char)); while(fgets(line,100,fp)!=NULL) { //Read a line from the file. printf("%s\n",line); } fclose(fp); return vecsum;}