Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8088273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:02:26+00:00 2026-06-05T19:02:26+00:00

there are 26 errors in this one sourceFile that I obtained from sourceForge. It

  • 0

there are 26 errors in this one sourceFile that I obtained from sourceForge. It is part of the Stanford CS106B library so should not have any errors.

A sample of errors:

  • C2059: syntax error : ‘public C2990: ‘Iterator’ : non-class template
    has already been declared as a class template
  • C2255: ‘friend’ : not allowed outside of a class definition
  • C2146: syntax error : missing ‘;’ before identifier ‘foreachHook’
  • C4430: missing type specifier – int assumed. Note: C++ does not support default-int
  • C2065: ‘FE_State’: undeclared identifier

with this many errors, intuition is that there is probably one simple reason not 26 complicated reasons.

/*
 * 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);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:02:28+00:00Added an answer on June 5, 2026 at 7:02 pm

    This file does not form valid C++ on its own. If you read the comments, it is taken out of bst.h to form the private portion of the class, without clients (users of the library) needing to see the details. private/bst.h only makes sense when it’s #included into bst.h at the right place. The compiler will then parse it in the correct context.

    Take a look at the file bst.h in the directory above this file (private/bst.h).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a report that shows all errors (if there are any) from a
I am using a master page... Then there is an .aspx that uses this
Ive had a similar question as this one before, and when that solved this
Recently I came across this error in my WCF trace: There was an error
I know there are two posts about this error on SO. Like every google
I am getting this error when trying to merge TFS2008. There are no pending
I get this error all the time. And as I can see, there are
Why is there no list-style infinite type error when I define something like this
Hello not sure why Im getting this error. Basically I get it in these
All are from this post . What does these statement mean: error(nargchk(5, 6, nargin));

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.