I am having trouble finding out if I did the header correctly

#include <iostream>
#ifndef TREE
#define TREE

// Node class
class Node 
    int key;
    Node* left;
    Node* right;
        left = NULL; 
        right = NULL; 
    void setKey(int aKey) { key = aKey; };
    void setLeft(Node* aLeft) { left = aLeft; };
    void setRight(Node* aRight) { right = aRight; };
    int Key() { return key; };
    Node* Left() { return left; };
    Node* Right() { return right; };

// Tree class
class Tree {
     Node* root;
     Node* Root() { return root; };
     void addNode(int key);
     void inOrder(Node* n);
     void preOrder(Node* n);
     void postOrder(Node* n);
     void addNode(int key, Node* leaf);
     void freeNode(Node* leaf);


Am I allowed to put an include statement there?

Move the include statement down below to line 4, after the ifdef statement. Yes, you can put include statements in header files, it's done all the time.

Edited 2 Years Ago by Ancient Dragon

You can hide node constructor body withing tree.cpp file as well.
Accessor functions could be const.
int Key() const { return key; };
Node* Left() const { return left; };
Node* Right() const { return right; };

void setKey(int aKey) could be void setKey(const int& aKey).
Same with 2 addNode functions.
void addNode(const int& key);
void addNode(const int& key, Node* leaf);

This question has already been answered. Start a new discussion instead.