C++ Programming Code Examples C++ > Pointers Code Examples Traversing the array using Pointers Traversing the array using Pointers #include <iostream> using namespace std; int main(){ //Pointer declaration int *p; //Array declaration int arr[]={3, 6, 9, 12, 15, 18}; //Assignment p = arr; for(int i=0; i<6;i++){ cout<<*p<<endl; //++ moves the pointer to next int position p++; } return 0; }