![]() |
|
#1
|
|||
|
|||
so sick of this stupid program HELP!CPP / C++ / C Code:
okay theres my code....I HAVE ERRORS about my = and << operators I tried to overload them but it still gave me errors. ANOTHER thing is how are use supposet to call in arrays from the user and store them did I declare them right? And also, MySet and set are they being declared correctly in my functions cuz I dont know where the hell anything is being stored Im sooo confused about this cuz I dont know where things are being stored in myset or set HELP me please thank u thank u thank u =) Last edited by LuciWiz : 02-Jul-2005 at 00:49.
Reason: Please insert your C++ code between [c++] & [/c++] tags
|
|||
|
#2
|
|||
|
|||
|
CPP / C++ / C Code:
can sum1 help me with these two errors??? Please 1)error C2676: binary '[' : 'const std::set<_Kty>' does not define this operator or a conversion to a type acceptable to the predefined operator 2)warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data Last edited by LuciWiz : 02-Jul-2005 at 00:50.
Reason: Please insert your C++ code between [c++] & [/c++] tags
|
|
#3
|
||||
|
||||
|
After 17 posts it seems someone by now would have mentioned the "Guidelines for posting requests for help" thread. I know it's hard to find, but not that hard...
I see LuciWiz has mentioned 8 times about using code tags. And every message he posts mentions the guidelines. maprich and QED specifically mentioned them to you. __________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
|
#4
|
|||
|
|||
|
Krandygrl00, like QED mentioned earlier, your class MySet inherits the class set and therefore you shouldn't make a protected set member in your class. Btw. no need for frustration. Take it easy - according to an old chinese saying: every 1000 mile journey starts with a single step.
So first clean your class definition. Currently you have: Quote:
CPP / C++ / C Code:
Here further suggestions for you: CPP / C++ / C Code:
Last edited by maprich : 02-Jul-2005 at 06:16.
Reason: typo
|
|
#5
|
|||
|
|||
|
CPP / C++ / C Code:
///////////////////////////////////////////////// I fixed up the code like you told me too. But im haveing errors with the union and intersect after i fixed it it was saying that unresolved linking error and to consult with tech support wow but newayz thank you for ur help...another error is that when i add elements in im only able to add elements into the first array and then not in the second and by this i get an error... |
|
#6
|
|||
|
|||
|
Not only your Intersect(..) but also methods Cardinality() and isSubset(MySet<Type> B) have to be rewritten. You have to make use of this pointer.
Super shortly about this pointer: Example Classes: CPP / C++ / C Code:
And then this pointer is a pointer to the current class object. In practice something like: CPP / C++ / C Code:
I wrote above explanation just so that you can begin to understand the reasons for the changes that I proposed (and which you implemented) in my previous post. So that you could see what is going on and could edit the methods like Cardinality() etc.etc. by yourself. You are attempting amazingly complex level code for someone who isn't familiar with this pointer and inheritance. To really understand what is going on you should study following individual topics: - OOP(Object Oriented Programming) inheritance, polymorphism & interfaces e.g. wiki.tcl.tk/13398 offers some explanation - C++ implementation of inheritance, visibility scopes, virtual inheritance, constuctors, method overloading, this pointer etc. - C++ templates e.g.www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html offers tutorial for inheritance and templates - C++ STL (Standard Template Library). Google turns up good tutorials about this subject too. |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| Type casts ? | kai85 | C++ Forum | 12 | 23-Jun-2005 13:04 |
| [TUTORIAL] Calling an external program in C (Linux) | dsmith | C Programming Language | 4 | 22-Apr-2005 14:30 |
| fltk-2.0 cvs | Plumb | FLTK Forum | 20 | 13-Nov-2004 08:10 |
| Need help with a C program (Long) | McFury | C Programming Language | 3 | 29-Apr-2004 21:06 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The