Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error: ISO C++ forbids declaration of with no type

I'm getting the following errors:

ISO C++ forbids declaration of ttTreeInsert with no type

ISO C++ forbids declaration of ttTreeDelete with no type

ISO C++ forbids declaration of ttTreePrint with no type

prototype for int ttTree::ttTreePrint() does not match any in class ttTree

candidate is: void ttTree::ttTreePrint()

Here is my header file:

#ifndef ttTree_h #define ttTree_h  class ttTree  { public:   ttTree(void);   int ttTreeInsert(int value);   int ttTreeDelete(int value);   void ttTreePrint(void);    };  #endif 

Here is my .cpp file:

#include "ttTree.h"  ttTree::ttTree(void) {    }  ttTree::ttTreeInsert(int value) { }  ttTree::ttTreeDelete(int value) { }  ttTree::ttTreePrint(void) { } 

Can anyone point out what is causing these errors? Thank you!

like image 348
user2264035 Avatar asked Apr 26 '14 17:04

user2264035


1 Answers

You forgot the return types in your member function definitions:

int ttTree::ttTreeInsert(int value) { ... } ^^^                

and so on.

like image 173
juanchopanza Avatar answered Oct 14 '22 23:10

juanchopanza