+1
-1
write a function template (generic function) to add two vector for basic data types such as float , double, long ,int and unsigned int.The general form of a template function f-definition in given below:
template
return-type function-name(parameter list) {body of function}
You can use the following declaration to add two vectors
(template < class X> void sum_vector(X &a, X &b, X &c ,int v_size)
{ You must fill this part}
Here a and b are the vectors to be added. c is the vector to store the result , and v_size is the size of vectors .Write only definition of the generic function.DO not write anything for the "int main() {} program.