打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
如何计算二维数组大小?? - C/C++ / C语言
int   str1[]={1,2,3,4,5,6};
int   size1=sizeof(str1)/sizeof(str1[0]);
cout < <size1 < <endl;

int   str2[][5]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
int   size2=sizeof(str2)/sizeof(str2[0][0]);
int   lines=sizeof(str2)/sizeof(str2[0]);
int   columns=size2/lines;
cout < < "the   total   number   is   " < <size2 < <endl;
cout < < "the   line   number   is   " < <lines < <endl;
cout < < "the   column   number   is   " < <columns < <endl;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
string的长度
华为机试HJ40:统计字符
密码验证合格程序
最全的C\C 面试题解(2)
C++中的虚函数(一)
《C++中类对象的内存布局和占用空间》《C++ 类里面,函数占用存储空间问题 》 demo...
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服