![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 28.02.2021 16:50 SAMANTHA8997
Your colleague developed a function, which is supposed to reverse an array of integers, e. g., {1, 5, -10, 7, 23} => {23, 7, -10, 5, 1}. Test cases show that the function does not work correctly. Please look at the following code and identify all the troubles. Please specify which part(s) of the code will not work and explain why not.
void ReverseArray(int arr[], size_t elements_no) {
size_t i = 0; int x = 0; for (i = 0; i <= elements_no; i++)
{ x = arr[i]; arr[i] = arr[elements_no - i]; arr[elements_no - i] = x; }
}
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 17:20, Morehollie9428
What is the best assassins creed game?
Answers: 2
You know the right answer?
Your colleague developed a function, which is supposed to reverse an array of integers, e. g., {1, 5...
Questions in other subjects:
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/obshestvoznanie.png)
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/obshestvoznanie.png)
![Konu](/tpl/images/cats/informatica.png)
![Konu](/tpl/images/cats/biologiya.png)