Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #point #array #pointer
ADD COMMENT
Topic
Name
5+2 =