0
我确实在Arduino项目中有两个简单类:C++ - Arduino - 没有匹配函数调用
这些类放在Point.h和Line.h文件中。
#include "Arduino.h"
#ifndef Point_h
#define Point_h
class Point{
public:
Point(int x);
int getPunkt();
void setPunkt(int x);
private:
int _x;
};
/////////////////////////////////
Point::Point(int x){
_x = x;
}
int Point::getPunkt(){
return _x;
}
void Point::setPunkt(int x){
_x = x;
}
#endif
和:
#include "Point.h"
#ifndef Line_h
#define Line_h
class Line{
public:
Line(Point p1, Point p2);
private:
Point _p1;
Point _p2;
};
Line::Line(Point p1, Point p2){
_p1 = p1;
_p2 = p2;
}
#endif
线的构造给了我:
在该行 多个标记 - 候选人是: - 呼叫到“点没有匹配的功能:: Point()'
我在做什么错?这只是一个简单的例子。
谢谢
非常感谢你。我不知道这个概念。它对我来说完全是新的。但我会消除你的链接。非常感谢你。这花了我一个晚上。 :-) – Dennis
不客气,而是先阅读重复的帖子。 – LogicStuff
是的,我在这个网站上搜索它,但没有找到答案。但抱歉双重发布的问题。 – Dennis