因为找了一份新工作,公司视觉平台是用C++来写的。以前Cognex用的C#。。。。。。。。
现在用C#在公司也就是能写写上位机软件了,哎心塞
别说还挺像的,第一次写。。。。
#include <iostream>
#include <string>
using namespace std;
class Goods
{
public:
Goods*next;
Goods() //无参构造函数
{
weight_ = 0;
next = NULL;
}
Goods(double weight) //有参构造函数
{
this->weight_ = weight;
this->next = NULL;
this->total_weight += weight;
}
~Goods()
{
std::cout << "删除一箱重量为:"<<weight_<<"货物"<<endl;
this->total_weight -= weight_;
}
static double Get_total_weight()
{
return total_weight;
}
priv