E2567 Illegal initialization of array '%s' (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

This occurs when the initialization of an array is not properly done.

typedef const char tstr[5];
        struct S {
            S(const tstr& p) : p_(p) {} // error: array used as initializer
            tstr p_;
        };
        void m(const tstr& p) {
            new S(p);
        }