/** save * Obtain file name from user and save locations and depths for all data
* currently in memory. If the file exists, append the data, otherwise
* create a new file.
* Data is saved in format:
* Line 1: Pit Location - A name that may contain spaces.
* Line 2: Pit Depth - Depth of pit in meters (2 decimal places)
*
* @param location array of strings containing the pit locations
* @param depth array of doubles containing the pit depths
* @param numdata integer
inserthow should i write depth and location such that when printed they look like below:Code:int save_data() { double depth[MAX_SIZE] = depth(toBottom); printf("\n Enter name of file to enter pit data to:\n"); gets (filename); if((fileptr= fopen(filename, "a"))==NULL) { printf("Error opening %s for writing. Program terminated.", filename); abort(); } size_t fwrite( const void *location, size_t MAX_SIZE, size_t i, FILE *fileptr); fclose (fileptr); return i; }
eldorado 01 -3.14
also when i try to compile i get a error
called object'depth' is not a function