![]() |
| ||
| help needed with errors Can someone help me please? I've got 17 errors and 3 warnings. The main problem is that it keeps telling me that "Triangle" isn't a class name :confused: i'm so confused. Could you also help me with any other problems that you see? Thx in advance. (list of errors at bottom) #include <iostream.h> C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(36) : error C2059: syntax error : 'constant' C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(37) : error C2228: left of '.cout' must have class/struct/union type C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(37) : error C2297: '<<' : illegal, right operand has type 'char [22]' C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(41) : error C2653: 'Triangle' : is not a class or namespace name C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(45) : warning C4508: 'Triangle' : function should return a value; 'void' return type assumed C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(47) : error C2653: 'Triangle' : is not a class or namespace name C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(52) : warning C4508: 'Triangle' : function should return a value; 'void' return type assumed C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(54) : error C2653: 'Triangle' : is not a class or namespace name C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(55) : error C2373: 'SetTriangle' : redefinition; different type modifiers C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(62) : error C2653: 'Triangle' : is not a class or namespace name C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(64) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(69) : error C2653: 'Triangle' : is not a class or namespace name C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(70) : error C2373: 'order' : redefinition; different type modifiers C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(79) : error C2653: 'Triangle' : is not a class or namespace name C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(83) : error C2653: 'Triangle' : is not a class or namespace name C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(87) : error C2653: 'Triangle' : is not a class or namespace name C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(93) : error C2144: syntax error : missing ';' before type 'int' C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(93) : error C2501: 'Triangle' : missing storage-class or type specifiers C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(93) : error C2373: 'Triangle' : redefinition; different type modifiers C:\Documents and Settings\owner\My Documents\C++\lab7\lab7.cpp(93) : fatal error C1004: unexpected end of file found |
| ||
| Re: help needed with errors Compare this with what you have: #include <iostream>But be sure to check all of the line numbers that your compiler is giving you errors on and try to guess what I changed to fix it. :) |
| ||
| Re: help needed with errors i see that you made the get_side functions constant, which helps with one of the problems, but what does the error mean when it says "error C2653: 'Triangle' : is not a class or namespace name"? |
| ||
| Re: help needed with errors Compare the operator== and operator<< functions between your version and mine. Therein lies the problem. Both Triange and friend should be removed from the front of the function tags, and Triangle is not the namespace that ostream is declared in. |
| ||
| Re: help needed with errors okay, yea i see that. but im still getting 14 errors :( *i feel so stupid right now* im so lost... :confused: i even tried your version of it .. |
| ||
| Re: help needed with errors Post the errors. Most likely we're using incompatible compilers where stuff like new headers and namespaces work for me but not for you. |
| ||
| Re: help needed with errors OMG! thank you so much! it worked. i just re-compiled it again and it was fine. i dont know why it was showing errors a few minutes ago :/ (now i just have to finish writing the code in main) could i pm you later if i have another question/problem come up? |
| ||
| Re: help needed with errors Sure, but be warned that I'm very busy during work hours, so I may not get to your question until tomorrow evening if I miss it tonight. |
| ||
| Re: help needed with errors thats fine. i dont think i will work on it more until tomorrow anyways. thanks again for all of your help :) |
| ||
| another small problem .... i've gotten rid of all of the errors and completed everything in my program except now i cant figure out how to get my "friend Triangle Copy(Triangle triangle1);" function to work correctly. It is supposed to copy one object into another. Could someone please help me? thx in advance heres the code i have now: #include <iostream.h> |
| All times are GMT -4. The time now is 1:17 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC