Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Zaid
  • Order by date
  1. Zaid

    Another Templated Class Question

    TreeMax is actually defined as follows - <br><br>ANYTYPE TreeMax();<br><br>My problem is that I don't know what to return in the case where the tree is empty, because ANYTYPE could be char, int, float, etc. Also, I'm trying to avoid having the user check that the tree is empty first.<br><br>Zaid
  2. Zaid

    Another Templated Class Question

    I have a templated class:<br><br>template &lt;class ANYTYPE&gt;<br>TREE {<br>public:<br>...<br>private:<br>&nbsp;struct Node {<br>&nbsp;&nbsp;ANYTYPE data;<br>&nbsp;&nbsp;Node * Right;&nbsp;&nbsp;// Pointer to Right Child Node<br>&nbsp;&nbsp;Node * Left;&nbsp;&nbsp;&nbsp;// Pointer to Left Child...
  3. Zaid

    Ideas for Loading Data from a File Into Templated Class Object

    I'm trying to write a function that loads data from a file into a templated class object. This is tricky because the fucntion has to ensure that the data in the file can be read in as the data type of the object.<br><br>i.e. If the file contains:<br>1<br>22<br>333<br><br>how can I get the...
  4. Zaid

    Templated Classes in MS Visual C++ 6.0

    You know what, I figured out what was going on. I included my *.cpp file in the project (a no-no for templated classes - it should be at the bottom of the *.h file). Everything works fine now.<br><br>Zaid
  5. Zaid

    Templated Classes in MS Visual C++ 6.0

    You know what, I had originally included the *.cpp file (include statement at the bottom of the *.h file, which is what I used to do when using the Borland Compiler), but that gave me errors that looked like this:<br><br>c:\ap\tree.cpp(257) : error C2084: function 'void __thiscall...
  6. Zaid

    Templated Classes in MS Visual C++ 6.0

    I'm trying to create a simple, templated binary tree class in Microsoft Visual C++ 6.0. I've done this before using a Borland Compiler (I forget which version exactly) and it worked fine, but with MS Visual C++, I get linking errors that look like this:<br><br>ttest.obj : error LNK2001...

Part and Inventory Search

Back
Top