假设我们有一个“itemtype.h”头文件,我在其中声明了以下项目:
#include<iostream>
#include<fstream>
using namespace std;
const int keyfieldmax=12;
const int kfmaxplus=keyfieldmax+1;
const int datafieldmax=36;
const int dfmaxplus=datafieldmax+1;
const int NULLCHAR='\0';
typedef char keyfieldtype[kfmaxplus];
typedef char datafieldtype[dfmaxplus];
typedef struct
{
keyfieldtype keyfield;
datafieldtype datafield;
}itemType;
现在,我需要从这个标题创建“btree.h”
#include "table.h"
int maxkeys=11;
int maxkeysplus=maxkeys+1;
const int minkeys=5;
const int nilptr=-1L;
typedef struct
{
int count;
itemType Key[maxkeys];
long branch[maxkeysplus];
}NodeType
但有以下两行
itemType Key[maxkeys];
long branch[maxkeysplus];
它说表达式必须具有常量值。那么我该如何解决呢?