C-PROGRAMMING
Arrays in C
Implement a function that concatenates two arrays with floating
point values into a new dynamically allocated array.
* \brief Concatenates two double valued arrays in a new
dynamically
* allocated array.
*
* \details The function concatenates arr1 of n1 double
elements and
* arr2 of n2 double
elements into a new dynamically allocated
* array. The destination
array should have the values of arr1 in
* its first n1 elements,
and its preceding elements (n1 onwards)
* should have the values of
the elements of arr2.
*
* \param arr1 The first array to be copied into the new array
* \param n1 The number of elements in arr1
* \param arr2 The second array to be copied into the new
array
* \param n2 The number of elements in arr2
* \return A new dynamically allocated array
*
* \note You don't need to free arr1 or arr2 as these might be
auto arrays.
*
* \note In your implementation, do not write to stdout to
check the functionality.
* You should use my_tests function to
print and check the functionality
* of your implementation.
*/
double* doublecat(const double* arr1,
unsigned int n1,
const double* arr2,
unsigned int n2) {
return NULL;
}
Arrays in C Implement a function that concatenates two arrays with floating point values into a new dynamically allocated array. The function concatenates arri of ni double elements and arr2 of n2 double elements into a new dynamically allocated array. The destination array should have the values of arri in its first ni elements, and its preceding elements ( ni onwards) should have the values of the elements of arr2.
C-PROGRAMMING Arrays in C Implement a function that concatenates two arrays with floating point values into a new dynami
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am