Computing length of array

后端 未结 10 1287
萌比男神i
萌比男神i 2020-12-19 13:37

I have a C++ array declared as mentioned below:

CString carray[] =
{
        \"A\",
        \"B\",
        \"C\",
        \"D\",
        \"E\"
}
10条回答
  •  旧巷少年郎
    2020-12-19 13:48

    Windows SDK (i.e. windows.h header) offers the macro ARRAYSIZE which implements this functionality in a safe manner(i.e. doesn't work with non-static arrays)

提交回复
热议问题