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

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

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

运行结果:

image

posted @ 2015-04-08 21:12  WQZ321123  阅读(337)  评论(0)    收藏  举报