Reverse Array using Pointers in C++ Last Updated : 23 Jun, 2025 Comments Improve Suggest changes Like Article Like Report Reversing an array is a common problem in programming where the task is to reorder the elements of the array so that the first element becomes the last, the second element becomes the second last, and so on.Example:Input: arr[] = {10, 20, 30, 40, 50}Output: 50 40 30 20 10To reverse an array using pointers, we can use two pointer approach: one pointing to the start of the array and other pointing to the end of the array while swapping the values at these pointers and moving the start pointer forward and the end pointer backward until pointers meet each other.Example Code C++ #include <iostream> using namespace std; void reverseArray(int* arr, int size) { // Pointer to first element int* start = arr; // pointer to last element int* end = arr + size - 1; // Until both pointers meet while (start < end) { // Swap values at start and end int temp = *start; *start = *end; *end = temp; // Move pointers start++; end--; } } int main() { int arr[] = {10, 20, 30, 40, 50}; int size = sizeof(arr) / sizeof(arr[0]); reverseArray(arr, size); for (int i = 0; i < size; i++) cout << *(arr + i) << " "; cout << endl; return 0; } Output50 40 30 20 10 Comment More infoAdvertise with us Next Article Reverse Array using Pointers in C++ A abhishekcpp Follow Improve Article Tags : C++ cpp-array cpp-pointer Practice Tags : CPP Similar Reads Pointers vs Array in C++ Arrays and pointers are two derived data types in C++ that have a lot in common. In some cases, we can even use pointers in place of arrays. But even though they are so closely related, they are still different entities. In this article, we will study how the arrays and pointers are different from e 3 min read Program to reverse an array using pointers Prerequisite : Pointers in C/C++ Given an array, write a program to reverse it using pointers . In this program we make use of * operator . The * (asterisk) operator denotes the value of variable . The * operator at the time of declaration denotes that this is a pointer, otherwise it denotes the val 4 min read Pointers and References in C++ In C++ pointers and references both are mechanisms used to deal with memory, memory address, and data in a program. Pointers are used to store the memory address of another variable whereas references are used to create an alias for an already existing variable. Pointers in C++ Pointers in C++ are a 5 min read Pointers vs References in C++ Prerequisite: Pointers, References C and C++ support pointers, which is different from most other programming languages such as Java, Python, Ruby, Perl and PHP as they only support references. But interestingly, C++, along with pointers, also supports references. On the surface, both references and 5 min read Pointer to an Array in C++ Pointers in C++ are variables that store the address of another variable while arrays are the data structure that stores the data in contiguous memory locations. In C++, we can manipulate arrays by using pointers to them. These kinds of pointers that point to the arrays are called array pointers or 6 min read Like