Basic
Practice Problems based on chapter which you learn in previous Tutorials.
Access Array Elements using Pointer
int
main
() {
int
numbers[] = {1, 2, 3, 4, 5};
int
*ptr = numbers;
std::cout
<< "Array elements using pointer: ";
for
(
int
i = 0; i < 5; ++i) {
std::cout
<< *(ptr + i) << " ";
}
std::cout
<< std::endl;
return
0;
}