fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a[] = {1, 2, 3, 4, 5, 6};
  6. cout << "Correct: The number of elements in a is " << sizeof a / sizeof &a[0] << endl;
  7. cout << "Wrong: The number of elements in a is " << sizeof a << endl;
  8. return 0;
  9. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Correct: The number of elements in a is 6
Wrong: The number of elements in a is 24