Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/142.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 引用自的错误:_C++_Build - Fatal编程技术网

C++ 引用自的错误:

C++ 引用自的错误:,c++,build,C++,Build,给定一个函数的定义,当两条边作为参数给定时,该函数在屏幕上打印出矩形的其余两条边: 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

给定一个函数的定义,当两条边作为参数给定时,该函数在屏幕上打印出矩形的其余两条边:

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;
}
主要问题是:

#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;
}
#包括
#包括“点h”
使用名称空间std;
int main()
{
点状第一点(1,2);
第三点(4,3);
库特
不一样

void Punct::restPuncte (Punct &x, Punct &y)

您正在定义一个自由函数,而您的
静态
方法仍然未定义。

其余的错误是什么?
void restPuncte (Punct &x, Punct &y)
void Punct::restPuncte (Punct &x, Punct &y)