Horje
print the elements of the array without using the [] notation in c++ Code Example
print the elements of the array without using the [] notation in c++
#include <iostream>
using namespace std;

int main()
{
    int arr[] = {2,4,8};
    int size = sizeof(arr) / sizeof(arr[0]);

    for (int i = 0; i < size; i++)
    {
        cout << *(arr + i) << "  "; // prints.. 2  4  8.
    }
}




Cpp

Related
Function to calculate compound interest in C++ Code Example Function to calculate compound interest in C++ Code Example
C++ to specify size and value Code Example C++ to specify size and value Code Example
geekforgeeks stacks Code Example geekforgeeks stacks Code Example
c++ program to print odd numbers using loop Code Example c++ program to print odd numbers using loop Code Example
c++ program to convert celsius to fahrenheit Code Example c++ program to convert celsius to fahrenheit Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8