Click here to Skip to main content
16,019,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to write a function, swapSubTrees, that swaps all of the left and right subtrees of a binary tree. Add this function to the class binaryTreeType and create a program to test this function. i keep getting the following errors and not sure what I am doing wrong here if someone could help I would really appreciate.

MSIL
++.exe "F:\Programming II class Winter Qtr\unit 10\main1.cpp" -o "F:\Programming II class Winter Qtr\unit 10\main1.exe"    -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include"  -I"C:\Dev-Cpp\include\c++\3.4.2\backward"  -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32"  -I"C:\Dev-Cpp\include\c++\3.4.2"  -I"C:\Dev-Cpp\include"   -L"C:\Dev-Cpp\lib"
F:\Programming II class Winter Qtr\unit 10\main1.cpp: In function `int main(int, char**)':
F:\Programming II class Winter Qtr\unit 10\main1.cpp:17: error: `insert' has not been declared
F:\Programming II class Winter Qtr\unit 10\main1.cpp:17: error: request for member of non-aggregate type before '(' token
F:\Programming II class Winter Qtr\unit 10\main1.cpp:22: error: `insert' has not been declared
F:\Programming II class Winter Qtr\unit 10\main1.cpp:22: error: request for member of non-aggregate type before '(' token
F:\Programming II class Winter Qtr\unit 10\main1.cpp:27: error: `print' has not been declared
F:\Programming II class Winter Qtr\unit 10\main1.cpp:27: error: request for member of non-aggregate type before '(' token
F:\Programming II class Winter Qtr\unit 10\main1.cpp:31: error: `printTree' has not been declared
F:\Programming II class Winter Qtr\unit 10\main1.cpp:31: error: request for member of non-aggregate type before '(' token
Execution terminated
Posted
Comments
Sergey Alexandrovich Kryukov 12-Mar-11 20:40pm    
Why asking something like that and not showing some code lines #17..31?
--SA

1 solution

Well, the error is self explanatory. Take a closer look and you will see

F:\Programming II class Winter Qtr\unit 10\main1.cpp:17: error: `insert' has not been declared

It is telling you something about insert? Can you see that. You need to define it before you can use it. May be you missed an include file or a path?
 
Share this answer
 
Comments
Member 7666290 12-Mar-11 10:35am    
i did see that, but I guess I don't see why it is saying that I looked and saw that it is included in my header file, do I also have to declare it my main?
Emilio Garavaglia 13-Mar-11 6:27am    
check ( ) , ;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900