eat*_*mon 13 c arrays static
static char* theFruit[] = { "lemon", "orange", "apple", "banana" };
通过查看这个数组我知道大小是4.如何以编程方式在C中查找此数组的大小?我不希望以字节为单位的大小.
Fre*_*Foo 32
sizeof(theFruit) / sizeof(theFruit[0])
注意sizeof(theFruit[0]) == sizeof(char *),一个常数.
sizeof(theFruit[0]) == sizeof(char *)
归档时间:
13 年,10 月 前
查看次数:
11540 次
最近记录: