相关文章推荐
玩滑板的啄木鸟  ·  js ...·  1 周前    · 
大方的滑板  ·  Resolve errors and ...·  2 周前    · 
欢乐的篮球  ·  Array.prototype.splice ...·  1 月前    · 
时尚的匕首  ·  Array.prototype.shift( ...·  1 月前    · 
暴走的钥匙  ·  ruby 数组array 排序sort ...·  3 月前    · 
潇洒的雪糕  ·  eslint中报错Parsing ...·  1 月前    · 
安静的手套  ·  【Excel VBA】- ...·  1 年前    · 
听话的楼房  ·  【无标题】React-hook + ...·  1 年前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

nonstandard extension used : zero-sized array in struct/union

Indicates that a structure or union contains an array that has zero size.

Declaration of a zero-sized array is a Microsoft extension. This causes a Level-2 warning when a C++ file is compiled and a Level-4 warning when a C file is compiled. C++ compilation also gives this warning: "Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array." This example generates warning C4200:

// C4200.cpp
// compile by using: cl /W4 c4200.cpp
struct A {
    int a[0];  // C4200
int main() {

This non-standard extension is often used to interface code with external data structures that have a variable length. If this scenario applies to your code, you can disable the warning:

Example

// C4200b.cpp
// compile by using: cl /W4 c4200a.cpp
#pragma warning(disable : 4200)
struct A {
    int a[0];
int main() {