You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// we can calculate the size of an array using sizeof() operator trick. First, we find the size occupied by the whole array in the memory and then divide it by the size of the type of element stored in the array. This will give us the number of elements stored in the array.
int main()
{
int arr[] = { 1, 2, 3, 4, 5 };
// Size of one element of an array
cout << "Size of arr[0]: " << sizeof(arr[0]) << endl;