Answers for "how to point to next array using pointer c++"

C++
0

how to point to next array using pointer c++

#include <iostream>
using namespace std;
int main() {
   int arr[5] = {1, 2, 3, 4, 5};
   int *ptr = &arr[0];
   cout<<"The values in the array are: ";
   for(int i = 0; i < 5; i++) {
      cout<< *ptr <<" ";
      ptr++;
   }
   return 0;
}
Posted by: Guest on October-12-2021

Code answers related to "how to point to next array using pointer c++"

Browse Popular Code Answers by Language