数组初始化Ç [英] Array initialization C

查看:144
本文介绍了数组初始化Ç的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么初始化的含义是:

What is the meaning of this initialization:

char arr[10] = { 0, };

我熟悉的改编的char [10] = {0}; 其中规定所有元素为零,并与字符ARR [ 10] = {1,2}; 它设置在前两个元件1和2(ASCII),其余为0。
我不熟悉上面的格式。
快速测试显示,它可能就像改编的char [10] = {0}; ,但有其他的意思,我不知道

I'm familiar with char arr[10] = {0}; which sets all the elements to zero, and with char arr[10] = {1,2}; which sets the first two elements to 1 and 2 (ascii) and the rest to 0. I'm not familiar with the format above. A quick test showed that it's probably just like char arr[10] = {0};, but is there other meaning I'm not aware of?

推荐答案

是的,这相当于与没有后面的逗号的版本。

Yes, it's equivalent with the version without the trailing comma.

请参阅this问题有关尾随逗号更多的讨论。

See this question for more discussion about trailing commas.

这篇关于数组初始化Ç的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆