0
在編譯代碼的第一行時出現錯誤「xxx does not named a type」。 知道「poligono」是「triangulo」的基類,並且我寫了.cpp和.h 文件。錯誤:xxx沒有指定類型
我想知道我可以修復這個錯誤
#include <string.h>
#include <iostream>
#include "poligono.h"
using namespace std;
triangulo :: triangulo(int x1i, int x2i, int x3i, int y1i, int y2i, int y3i, string clasei, int ancho, int alto, int puntos) :: poligono(int ancho, int alto, int puntos){
this-> x1 = x1i;
this-> x2 = x2i;
this-> x3 = x3i;
this-> y1 = y1i;
this-> y2 = y2i;
this-> y3 = y3i;
}
triangulo :: triangulo(int x1, int x2, int x3, int y1, int y2, int y3, string clasei, const otro&) :: poligono (otro.ancho, otro.alto, otro.puntos){
this-> x1 = otro.x1;
this-> x2 = otro.x2;
this-> x3 = otro.x3;
this-> y1 = otro.y1;
this-> y2 = otro.y2;
this-> y3 = otro.y3;
this->clase = clasei;
}
#ifndef TRIANGULO_H
#define TRIANGULO_H
#include "poligono.h"
#include <iostream>
#include <string>
using namespace std;
class triangulo : public poligono{
private:
string clase;
const int lados = 3;
int x1;
int y1;
int x2;
int y2;
int x3;
int y3;
public:
triangulo (int x1i, int x2i, int x3i, int y1i, int y2i, int y3i, string clase);
triangulo (const &otro);
setx1(int x1i);
setx2(int x2i);
setx3(int x3i);
sety1(int y1i);
sety2(int y2i);
sety3(int y3i);
getx1();
getx2();
getx3();
gety1();
gety2();
gety3();
getlados();
getclase();
};
#endif
這裏有多個問題。 – 0x499602D2
錯誤信息中的「xxx」是什麼? –