本文介绍了零用C code数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
How can I zero a known size of an array without using a for or any other loop ?
For example:
arr[20] = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
This is the long way... I need it the short way.
解决方案
int arr[20] = {0};
C99 [$6.7.8/21]
这篇关于零用C code数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!