嘿所有IM如果香港專業教育學院做了一個語法錯誤,但聽到香港專業教育學院做了一個類,當我嘗試編譯它得到這個錯誤不知道....編譯類與GCC
dining.h:7:1: error: unknown type name ‘class’
dining.h:7:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
它工作正常G ++,但我不得不使用gcc ...
這就是問題所在代碼..
#ifndef DINING_H
#define DINING_H
class DiningSet {
public:
DiningSet();
~DiningSet();
void getSize(); // accepts X and Y dimentions of the table (in metres)
//void surfaceArea(int,int); // Calculates Surface Area of table (in square metres)
void numChairs(); // accepts number of chairs
void cushionColour(); // accepts a cushion colour
void woodType(); // accepts wood type
void priceComp(); // computes a price of set
void purchaseDet(); // displays details of purchase
void purchasePrice(); // displays price of purchace
private:
int X, Y; // Dimentions of table
float Surface;
int chairs; // Number of chairs
char colour; // colour of cushion (should be dynamic array)
char wood;
float totalPrice;
};
#endif
請顯示您當前使用的命令行。 – 2012-03-13 05:20:44