0

Can someone help me in pointer in c++

#include <iostream> using namespace std; int main() { // create an array int num[4] = {3, 6, 9, 12}; // create a pointer variable int *ptr; cout << "Array Elements: "; // loop through array using ptr for (ptr = num; ptr <= &num[3]; ++ptr) { cout << *ptr << " "; } return 0; } // Array Elements: 3 6 9 12 Please explain for loop

29th Jan 2023, 12:15 PM
Girish Sahu
Girish Sahu - avatar
2 Respostas