Search code examples
ctypesbinary-treeconflict

c++ Binary tree conflicting types error


Q:Could someone give a hint, why inside my program here are conflicting types, even if its the same?


Solution

  • If you call a function before it is defined (i.e. earlier in the file than the definition), the compiler won't know the argument types and return type. You need to have a function prototype before the function is called. Usually people put function prototypes in header files, but you could just add one near the top of your file.