编译代码时出错
Error while compiling the code
我在编译时收到一条错误消息,说
node.h: In member function ‘void binary_tree::print(node*&, std::ofstream&)’:
node.h:17:10: error: ‘node* node::left_child’ is private
但是在node.h中,成员是公共
class node {
public:
char *word;
int frequency;
node *left_child;
node *right_child; };
使用MinGW进行构建和运行。请帮我解决这个问题。
您需要提交完整的代码以获得评论。
- 如果left_child是公共的,则不会发生错误。您可以清理和重新生成代码
- binary_tree这个类是如何使用类节点的
它运行得很好!!!但这里出现了一些构建错误。这是修改后的代码https://drive.google.com/file/d/0B5PwxyqEos-wb05vRzhvN21aYTQ/edit?usp=sharing
相关文章:
- 在Linux for Windows上编译C++代码时出错
- 尝试将另一个子句添加到代码中时出错
- 将代码从 Python 转换为 C++ 时出错
- <limits> 使用 VSC2019 编译旧代码时出错
- 使用 Visual Studio 代码读取 C++ 中的输入流时出错
- 在OpenGL中使用程序集代码渲染视频时出错
- 编译以下代码时出错
- Boost FFT示例-编译时出错,这段代码在做什么
- 编译在 Python 代码内部调用的 C++ 代码时出错,使用 Boost Python
- C++:为什么这段代码会出错?多元线性回归
- 混合开放MP/MPI代码中的多线程发送/接收时出错
- 将节点 js 代码集成到 cpp 库时出错
- 构建代码时出错
- 在字符串流中使用来自 github 的代码时出错
- 在主代码中调用 .hpp 函数时出错
- 将 find_if() 与数组一起使用的代码段中出错
- 我在字数C++的代码中哪里出错了
- 尝试从 Github 编译 OpenCV QT 代码时出错
- 编译创建 Eigen::ThreadPoolDevice 对象的代码时出错
- 编译 .cu 与 .cpp:即使没有任何 CUDA 代码,编译器也会出错