2つのエッジが引数として指定されている場合に、長方形の残りの2つのエッジを画面に出力する関数の定義を考えると、次のようになります。
static void restPuncte (Punct &x, Punct &y);
およびその実装:
void restPuncte (Punct &x, Punct &y)
{
Punct c;
c.MutaX(x.GetX());
c.MutaY(y.GetY());
Punct d;
d.MutaX(y.GetX());
d.MutaY(x.GetY());
std::cout << "Punctul C este:" << c << std::endl;
std::cout << "Punctul D este:" << d << std::endl;
}
主に、プロジェクトをビルドしようとすると、次のエラーが発生します。
"Punct::restPuncte(Punct&, Punct&)", referenced from:
主なものは次のとおりです。
#include <iostream>
#include "punct.h"
using namespace std;
int main ()
{
Punct firstPoint(1,2);
Punct thirdPoint(4,3);
cout << "Determinarea celorlalte doua colturi" << endl;
cout << "Cele doua puncte sunt:" << firstPoint << " si " << thirdPoint <<endl;
Punct::restPuncte(firstPoint,thirdPoint);
return 0;
}
私が間違っているのは何ですか?ありがとうございました!