私はこのプログラムの最初のステップにいるだけですが、コードを作成しているのでコンパイルするのが好きです。また、私はADTを初めて使用するので、このコードを作成するときに、それらが何を意味するのかわからないいくつかの問題に遭遇しました。
式.h
#include "header.h" //Library that contains thing like iomanip, cstring, etc.
class Expression
{
private:
char *ieEXP; //Array of characters
char *peEXP; //Array of characters
const int MAX = 40; //Max size for the array
public:
//Initialize both arrays to 0
Expression(){ieEXP[MAX] = {0}, peEXP[MAX] = {0}};
Expression(const Expression &);
//Destroy contents within the array after program completes
~Expression(){ieEXP[MAX] = {0}, peEXP[MAX] = {0}};
//void ReadInFix(char *ieEXP);
//void PrintInFix(char *ieEXP);
//void StrCatch();
//bool IsOperator();
//void IntoPostFix(char *peEXP);
//void PrintPostFix(char *peEXP);
//int Priority();
};
コンパイル
g++ -c Expression.h
これは私が得る正確なエラーです
Expression.h:1: error: expected constructor, destructor,
or type conversion before string constant
また、他のメソッドはまだ使用されておらず、単にクラスを作成しただけであり、int main はまだ何も呼び出されていません。
ありがとうございました。