- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我从 sourceForge 获得的这个源文件中有 26 个错误。它是 Stanford CS106B library 的一部分所以应该不会有任何错误。
错误示例:
有这么多错误,直觉是可能有一个简单的原因,而不是 26 个复杂的原因。
/*
* File: private/bst.h
* Last modified on Fri Jun 5 15:40:43 2009 by eroberts
* -----------------------------------------------------
* This file contains the private section of the bst.h interface.
* This portion of the class definition is taken out of the bst.h
* header so that the client need not have to see all of these
* details.
*/
public:
/*
* Class: BST<ElemType>::Iterator
* ------------------------------
* This interface defines a nested class within the BST template that
* provides iterator access to the keys contained in the BST.
*/
class Iterator {
public:
Iterator();
bool hasNext();
ElemType next();
private:
struct iteratorMarkerT {
void *np;
bool processed;
};
Iterator(BST *bstp);
BST *bstp;
Stack<iteratorMarkerT> stack;
long timestamp;
void advanceToNextNode();
void findLeftmostChild();
friend class BST;
};
friend class Iterator;
ElemType foreachHook(FE_State & _fe);
/*
* Deep copying support
* --------------------
* This copy constructor and operator= are defined to make a
* deep copy, making it possible to pass/return trees by value
* and assign from one tree to another. The entire contents of
* the tree, including all elements, are copied. Each tree
* element is copied from the original tree to the copy using
* assignment (operator=). Making copies is generally avoided
* because of the expense and thus, trees are typically passed
* by reference, however, when a copy is needed, these operations
* are supported.
*/
const BST & operator=(const BST & rhs);
BST(const BST & rhs);
private:
/* Type definition for node in the tree */
struct nodeT {
ElemType data;
nodeT *left, *right;
int bf; /* AVL balance factor */
};
/* Constant definitions */
static const int BST_RIGHT_HEAVY = +1;
static const int BST_IN_BALANCE = 0;
static const int BST_LEFT_HEAVY = -1;
/* Instance variables */
nodeT *root;
int numNodes;
long timestamp;
int (*cmpFn)(ElemType, ElemType);
/* Private method prototypes */
nodeT *recFindNode(nodeT *t, ElemType & key);
bool recAddNode(nodeT * & t, ElemType & key, bool & createdNewNode);
bool recRemoveNode(nodeT * & t, ElemType & key, bool & didRemove);
bool removeTargetNode(nodeT * & t);
void updateBF(nodeT * & t, int bfDelta);
void recDeleteTree(nodeT *t);
void recBSTAll(nodeT *t, void (*fn)(ElemType));
void fixRightImbalance(nodeT * & t);
void fixLeftImbalance(nodeT * & t);
void rotateRight(nodeT * & t);
void rotateLeft(nodeT * & t);
void copyOtherEntries(const BST & other);
/* Template method prototypes */
template <typename ClientDataType>
void recBSTAll(nodeT *t, void (*fn)(ElemType, ClientDataType &),
ClientDataType & data);
最佳答案
此文件本身不构成有效的 C++。如果您阅读注释,它会从 bst.h
中取出,形成类的私有(private)部分,客户端(库的用户)不需要查看详细信息。 private/bst.h
只有在正确的位置被 #include
d 到 bst.h
时才有意义。然后编译器将在正确的上下文中解析它。
查看此文件上方 目录中的文件bst.h
(private/bst.h
)。
关于c++ - sourceFile 编译器错误 - 常见问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11006882/
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
是否了解线程的同步和异步? 线程同步:多个线程同时访问同一资源,等待资源访问结束,浪费时间,效率低 线程异步:在访问资源时在空闲等待时同时访问其他资源,实现多线程机制 是否了解网
常见问题 cat系统的定位 cat本质上一个实时监控系统,主要体现在监控报表Transaction、event、problem、heartbeat等,cat系统定制的监控模型以及定制的实时分
我正在使用PowerShell中的GUI并尝试制作表单,以便在构建表单之后,用户可以与表单的一部分(+/-按钮)进行交互,以向该表单动态添加一组控件现有集的下方。 例如,将有一个组合框(下拉菜单)用于
尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出整个
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
我不知道如何在 C++ 项目中使用 TDD,但我决定先使用“Google Mock Framework”。 但我有一个问题: 当我完成测试时,是否必须从 TDD 的宏、类等中清理我的代码? 换句话说,
我从 sourceForge 获得的这个源文件中有 26 个错误。它是 Stanford CS106B library 的一部分所以应该不会有任何错误。 错误示例: C2059:语法错误:'publi
处理现有的展开/折叠“FAQ” Accordion 页面并希望“展开/折叠”功能正常工作。 我设法让页面开始时所有内容都折叠起来,但是当我单击任何列展开然后单击另一列时,原始列不会折叠。 重要的是,我
可以从 MySQL 数据库获取“常见问题解答”。我有一个存储问题和答案的表。每天在我的网站上我们都会收到数千个问题。 现在我统计一下,我的数据库中有 142,283 个问题。我的想法是通过创建常见问题
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我有以下 html。它由 bootstrap 和 css url 文件组成。它有两个 Accordion 项目选项卡。但是打开的时候发现有javascript错误。当我单击 Accordion 时,它
我观看/阅读/搜索了许多教程,但都没有成功。我坚持 this tutorial . 我正在尝试将带有 JS(可能仅 CSS)的 toogle acordion 效果应用到 div 而不定位。 有两种显
我讨厌问这个问题,因为它已经被问了一百万次,但答案似乎从来都不令人满意,而且大多数线程似乎都没有得到公认的答案就被放弃了。 这正是我需要做的(由于业力低,恶意网址是故意的): http://examp
我正在使用 CRNA v0.44 。我正在进行两个屏幕注册。我在第一个屏幕上,现在我想使用 react 导航转到第二个屏幕。 但是出现错误: undefined is not an object (e
我是一名优秀的程序员,十分优秀!