Listing 1 scopel.cpp: shows that declarations are statements

#include <iostream.h>

main()
{
   int a[] = {0,1,2,3,4};
   
   //  Print address and size
   cout << "a == " << (void *) a << endl;
   cout << "sizeof(a) == " << sizeof(a) << endl;
   
   //  Print forwards
   size_t n = sizeof a / sizeof a[0]; // line 8
   for (int i = 0; i < n; ++i)        // line 9
      cout << a[i] << ' ';
   cout << endl;
   
   //  Then backwards
   for (i = n-1; i >= 0; --i)
      cout << a[i] << ' ';
   cout << endl;
   return 0;
}

/* Output:
a == 0xffec
sizeof(a) == 10
0 1 2 3 4
4 3 2 1 0
*/

// End of File