Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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.
    }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: initialise a vector c++ 
Cpp :: multiple inheritance c++ 
Cpp :: find the number of digits of a given integer n . 
Cpp :: labs c++ 
Cpp :: xor in c++ 
Cpp :: find largest number in each row in array c++ using function 
Cpp :: how to read and write to a file in qt c++ 
Cpp :: 1047. Remove All Adjacent Duplicates In String solution leetcode in c++ 
Cpp :: C:UsersBBCDocumentsc n c++ project8PuzzleSolvemain.c|38|warning: suggest parentheses around assignment used as truth value [-Wparentheses]| 
Cpp :: cf 633b trivial problem explanation 
Cpp :: cpp-variadics/problem? 
Cpp :: C++ thread header 
Cpp :: inbuilt function for bin to dec in c++ 
Cpp :: comment savoir si un nombre est premier c++ 
Cpp :: time out search element in linked list c++ 
Cpp :: c++ vs c# 
Cpp :: add nested vector cpp 
Cpp :: boundary traversal of binary tree 
Cpp :: permutation and combination program in c++ 
Cpp :: converter python to c++ code 
Cpp :: c++ const shared_ptr 
Cpp :: jquery ajax post json asp.net core 
Cpp :: c++ auto loop 
Cpp :: fenwick tree 
Cpp :: array list cpp 
Cpp :: can derived class access private members 
Cpp :: opengl text rendering with 3d rendering 
C :: clear screen c 
C :: pygame draw transparent rectangle 
C :: execution time of c program 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =