C++ Array Initializers Warnings

后端 未结 2 480
暗喜
暗喜 2021-01-14 14:59

I have declared and initialized a constant char array within a class:

class grid {
    const char test[11] = {\'s\', \'e\', \'1\', \'2\', \'3\', \'4\', \'5\'         


        
2条回答
  •  悲哀的现实
    2021-01-14 15:36

    To make it C++98 compatible, you need to initialize non-static class constants outside of the class declaration.

提交回复
热议问题