Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 09-05-2010, 03:49 PM   #1
LordZsar1
Forum hobbit
 
LordZsar1's Avatar


 
Join Date: Nov 2007
Location: Leipzig, Germany
Posts: 26
Send a message via AIM to LordZsar1 Send a message via MSN to LordZsar1
Default C++ program doing weird stuff

Could someone please do me a favour and compile this stuff on his system, then try to run it and give me the console output?

Sortierverfahren.cpp line 23 does something I have never seen happen before, when I try to run the program - and I have not the slightest idea as to what could cause this.
Apparently I somehow broke that STL container. Or my OS. Or my PC. ~~
And I would like to know which one of these three.

Compiled with "g++ -Wall -Wextra -o Test *.cpp".

... Oh, of course, if you see my fault, feel free to tell me about it - I am at the end of my wisdom.

Last edited by LordZsar1; 09-05-2010 at 09:49 PM.
LordZsar1 is offline                         Send a private message to LordZsar1
Reply With Quote
Old 09-05-2010, 08:08 PM   #2
LordZsar1
Forum hobbit
 
LordZsar1's Avatar


 
Join Date: Nov 2007
Location: Leipzig, Germany
Posts: 26
Send a message via AIM to LordZsar1 Send a message via MSN to LordZsar1
Default

Solved. Turned out that copy-constructors of parent classes tend not to work in a defined way when invoked from children...

That does not mean that my code works now - cout seems to be a greater menace than anyone cared to tell me. ~~
LordZsar1 is offline                         Send a private message to LordZsar1
Reply With Quote
Old 09-05-2010, 09:48 PM   #3
LordZsar1
Forum hobbit
 
LordZsar1's Avatar


 
Join Date: Nov 2007
Location: Leipzig, Germany
Posts: 26
Send a message via AIM to LordZsar1 Send a message via MSN to LordZsar1
Default

It's out to get me, that is the sole explanation! But I can do something it has not planned for, I can suprise it, ha, and I will suprise it: by exposing it to the world!

If anyone feels like having a little bit of unused time and grand need for a headache, mayhap he can take a look at this and tell me, where exactly I... how is it said... "fucked up".

ItemSet.h


ItemSetContainer.h


Sortierverfahren.h


ItemSet.cpp


ItemSetContainer.cpp


Sortierverfahren.cpp


Test.cpp


The whole thing compiles under Windows and with minimal changes under Linux, but while it works "somewhat" under the former, it does not even do a little under the latter.
LordZsar1 is offline                         Send a private message to LordZsar1
Reply With Quote
Old 28-05-2010, 04:05 AM   #4
Two Sheds
Newbie

 
Join Date: Jan 2010
Location: Toronto, Canada
Posts: 10
Default

not sure if you are still looking at this, but one problem that I see is that in ItemSet::~ItemSet() you are deleting some things you shouldn't be. You only delete things you new.

I'm not that familiar with c/c++ anymore, haven't used it regularly for a long time, if you are still looking at this I can take a longer look...
Two Sheds is offline                         Send a private message to Two Sheds
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Dreams Suiton On site 2 30-06-2009 03:53 PM
OK this is weird... Mrazerty Trash Can 5 04-05-2008 02:11 AM
This Is Weird I Need Help malice Troubleshooting 4 21-11-2005 11:13 PM


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 05:01 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.