Note that there are some explanatory texts on larger screens.

plurals
  1. POerror C2143: syntax error : missing ';' before '*' when declaring pointer
    text
    copied!<p>This is header file for my binary tree. I have a class called TreeNode and of course BinaryTree class have a pointer to its root.</p> <p>And I got following Three errors</p> <pre><code>error C2143: syntax error : missing ';' before '*' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int </code></pre> <p>And Code for BinaryTree header file </p> <pre><code>#pragma once #include &lt;fstream&gt; #include &lt;iostream&gt; #include "Node.h" using namespace std; class BinaryTreeStorage { private: TreeNode* root; public: //Constructor BinaryTreeStorage(void); //Gang Of Three ~BinaryTreeStorage(void); BinaryTreeStorage(const BinaryTreeStorage &amp; newBinaryTreeStorage); BinaryTreeStorage&amp; operator=(const BinaryTreeStorage &amp; rhs); //Reading and writing ofstream&amp; write(ofstream&amp; fout); ifstream&amp; read(ifstream&amp; fin); }; //Streaming ofstream&amp; operator&lt;&lt;(ofstream&amp; fout, const BinaryTreeStorage&amp; rhs); ifstream&amp; operator&gt;&gt;(ifstream&amp; fin, const BinaryTreeStorage&amp; rhs); </code></pre> <p>error appears to be at line 11</p> <pre><code> TreeNode* root; </code></pre> <p>I have spent few days trying to get rid of this error and completely devastated.</p> <p>Is this error about wrong namespace ? Or maybe TreeNode class not declared right?</p> <p>And just in case code for TreeNode header file</p> <pre><code>#pragma once #include &lt;string&gt; #include "BinaryTreeStorage.h" using namespace std; class TreeNode { private: string name; TreeNode* left; TreeNode* right; public: //Constructor TreeNode(void); TreeNode(string data); //Gang of Three ~TreeNode(void); TreeNode(const TreeNode* copyTreeNode); //Reading and writing ofstream&amp; write(ofstream&amp; fout); //Add TreeNode void addTreeNode(string data); //Copy tree void copy(TreeNode* root); }; </code></pre> <p>Thank you in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload