Question: Write a readdata function which takes as input a meta file with the following structure: The first number is an integer that tells the program

Write a readdata function which takes as input a meta file with the following structure: The first number is an integer that tells the program how many values (n) are in the file. The next n numbers are the values to be read in. For example the following file would read 5 values. 5 5 1.0 2.2 3.3 4.4 5.5 Make sure the function has the following properties: (5 points) Open a file and read the values in the correct way. (5 points) You are to allocate the correct number of values for an array of double values. . (5 Points) Pass the pointer (or result array) and the count back to the caller (e.g., main function) correctly. (5 points) Create a main function where you call the function and return the pointer/array data. Then, write a loop to print all the values of the array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
