Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Programming (http://www.abandonia.com/vbullet/forumdisplay.php?f=25)
-   -   C++ program doing weird stuff (http://www.abandonia.com/vbullet/showthread.php?t=24625)

LordZsar1 09-05-2010 03:49 PM

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.

LordZsar1 09-05-2010 08:08 PM

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 09-05-2010 09:48 PM

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.

Two Sheds 28-05-2010 04:05 AM

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...


The current time is 08:57 AM (GMT)

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