在Node.h中代码为:
#pragma once
class Node
{
public:
virtual double cal() const = 0;
virtual ~Node();
};
class NumberNode:public Node
{
public:
double cal() const;
private:
double num;
}
Node.cpp中代码:
#include "Node.h"
double NumberNode::cal() const
{
return num;
}
main.cpp中:
#include<iostream>
int main()
{
return 0;
}
不能通过编译。。。。。把几个代码在同一文件中,则可以通过代码。为啥??
#pragma once
class Node
{
public:
virtual double cal() const = 0;
virtual ~Node();
};
class NumberNode:public Node
{
public:
double cal() const;
private:
double num;
}
Node.cpp中代码:
#include "Node.h"
double NumberNode::cal() const
{
return num;
}
main.cpp中:
#include<iostream>
int main()
{
return 0;
}
不能通过编译。。。。。把几个代码在同一文件中,则可以通过代码。为啥??