「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
しかし、次の2行で
itemType Key[maxkeys];
long branch[maxkeysplus];
式には定数値が必要です。では、どうすれば修正できますか?