Question: C++ pls Write functions with the following headers: int* readVector(char fname[], int &size) This function should read values from the file and save them in

C++ pls  C++ pls Write functions with the following headers: int* readVector(char fname[],

Write functions with the following headers: int* readVector(char fname[], int &size) This function should read values from the file and save them in a 1D array (vector) and return a pointer to it. The first element in the file is number of values followed by the values. Note that size is passed to the function by reference, so you have to define it in the caller. void print Vector(char fname[], int *M, int size) This function should print the content of the 1D array to the output filet. void VectorMult (int *A, int *B, int *R, int size) The function perform a scalar multiplication the vector with the vector and save the result in vector. (element by element multiplication) Test the function with a program that reads two files "input1.txt" and "input2.txt" and save the results in pointers A and B, call the VectorMult to calculate the vector R then finally print the result in the file "output.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!