C++ expected constant expression

前端 未结 8 1489
日久生厌
日久生厌 2020-11-30 10:42
#include 
#include 
#include 
#include 
#include 
using std::ifstream;
using namespace std;
         


        
8条回答
  •  臣服心动
    2020-11-30 11:27

    You cannot have variable length arrays (as they are called in C99) in C++. You need to use dynamically allocated arrays (if the size varies) or a static integral constant expression for size.

提交回复
热议问题