【发布时间】:2010-04-16 22:12:45
【问题描述】:
我正在尝试使用 this 教程在 C++ 中使用 Gnuplot 制作绘图。但是我将在一个类中使用管道连接到 Gnuplot,但后来我遇到了一些问题:
我有一个头文件,其中声明了所有变量等。我也需要在这里声明pipe-变量,但我该怎么做呢?
我试过直接做,但是没用:
记录器.h:
class Logger {
FILE pipe;
}
Logger.cpp:
Logger::Logger() { //Constructor
*pipe = popen("gnuplot -persist","w");
}
给出错误Logger.cpp:28: error: no match for ‘operator=’ in ‘*((Logger*)this)->Logger::pipe = popen(((const char*)"gnuplot -persist"), ((const char*)"w"))’
建议?
【问题讨论】: