#include "stdafx.h"
#include <iostream>
using namespace std;

int  main()
{
    int a[100]={0};
    cout<<sizeof(a)/sizeof(a[0])<<endl;
    return 0;
}

运行结果:

对于数组使用sizeof(a)和使用sizeof(a[0])

相关文章:

  • 2022-01-26
  • 2021-06-27
  • 2022-12-23
  • 2021-10-07
  • 2021-05-24
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
相关资源
相似解决方案