Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ array access operator

// CPP program to demonstrate []
// operator
#include <iostream>
using namespace std;
int main()
{
    char name[] = "Ramswarup Tushar Nilesh Subhash";
  
    // Both of the statement prints same thing
    cout << name[5] << endl;
    cout << 5 [name] << endl;
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #array #access #operator
ADD COMMENT
Topic
Name
5+5 =