I know i havent worked on the calculations yet but i asked the compiler to bring a file from a place but that file name Which is one.dat, compiler cant seem to find it or something cause its unidentified.Code://constants #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define RANDOM 256 #pragma warning(disable: 4996) int main(int argc, char *argv[]) { //declarations char MiscNumbers[RANDOM]; int data = 0; int sum = 0; int range = 0; float mean = 0.0; float variance = 0.0; float deviation = 0.0; FILE *fp; FILE * outFileHandle = NULL; fp = fopen("\\zeus\profile$\955290767\Desktop\StdDev\one.dat" , "r"); if (fp == NULL) { strncpy(one.dat, argv[1], RANDOM); } else { puts("Enter the name of the file to read (source):"); fgets(one.dat, RANDOM, stdin); if(one.dat[strlen(one.dat) - 1 == '\n') prog2a[strlen(prog2a) - 1] = '\0'; else while(getchar() != '\n'); } fp = fopen(argc[0], "r"); if(fp == NULL) { printf("Could not open file %s for input.\n" "Press any key to Continue" , one.dat ); getchar(); return EXIT_FAILURE; } while (fscanf(fp, "%d" , &numberInSet) != EOF) { printf("The results from file dat1.dat are: /n"); printf("--------------------------------------- /n"); printf("| # of data | Sum | Range | Mean | variance | standard deviation | /n"); for (i=0; i<numberInSet; i++) { printf("| %d | %d | %d to %d | %f | %f | %f | /n"); } } //calculations //bring the numbers from the file copy it to the arrays and store it. then //close the file and calculate all the rest getchar(); return EXIT_SUCCESS;




Reply With Quote