Use sizeof operator on an array name: returns the number of bytes in the array : sizeof « Operators statements « C++ Tutorial






#include <iostream>
using std::cout;
using std::endl;

int main()
{
   double array[ 20 ];
   cout << "The number of bytes in the array is " << sizeof( array );
   return 0;
}
The number of bytes in the array is 160








3.6.sizeof
3.6.1.Demonstrate sizeof.
3.6.2.sizeof a union
3.6.3.sizeof a class
3.6.4.Object sizes
3.6.5.Using the sizeof operator for base class and derived class
3.6.6.Use sizeof operator on an array name: returns the number of bytes in the array