An array has contiguous addresses - C++ Data Type

C++ examples for Data Type:Array

Description

An array has contiguous addresses

Demo Code

#include <iostream>
using namespace std;
int main() {/*w ww .  j  a  va2s.  c  o  m*/
   int a[10];
   cout << "sizeof(int) = "<< sizeof(int) << endl;
   for(int i = 0; i < 10; i++)
      cout << "&a[" << i << "] = " << (long)&a[i] << endl;
}

Result


Related Tutorials