FP Practice Week 14 2
FP Practice Week 14 2
Course: Fundamentals
of C++ Programming
Topic: Pointers. Passing Parameters
Practice 2
Task 1. Write a function that receives a pointer to an array
and its size and returns the sum and product of its elements
in two pointer parameters.
Task 2. Write a function that receives a pointer to an array
and its size and returns the number of negative, positive, and
zero elements in the array.
Task 3. Write a function that takes pointers to two arrays (A
and B) and array sizes as an argument. The function checks
whether array B is a subset of array A and returns a pointer
to the beginning of the found fragment, otherwise 0.
Task 4. Write a function that receives a pointer to a dynamic
array and its size. The function must remove all negative numbers
from the array and return a pointer to a new dynamic array.
Task 5. Create a function that adds a block of elements to
the end of an array.
Task 6. Create a function that inserts a block of elements
starting at arbitrary array index.
Task 7. Create a function that allows you to delete a block of
elements starting at arbitrary array index.
1