[Dev-C++] slowing down program to avoid segmentation fault
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Kris N. <kri...@ag...> - 2003-04-24 14:59:14
|
Dear all, I'm facing a problem that I have to slow down my program to avoid a segmentation fault - or at least that is how I interprete my problems. I have a class function that sorts a matrix. When I put cin.get(); before this function, the function works. When I remove cin.get();, I get a segmentation fault. A few lines further it works without any problems in a for() routine. Strange enough the cout function one line after my sort function always works. I get the impression, but am not a profressional programmer, that functions run more or less simultaneously. It looks as if cout is started before the sort function is finished. Has it something to do with threading, I heard about it, never looked at it. Has anyone an idea what's going on, probably it's quite obvious for a professional? Are there good references where I can find more information? Regards, Kris -- ------------------------------------------------------------------------ http://perswww.kuleuven.ac.be/~u0027178/VCard/mycard.php?name=krisn ------------------------------------------------------------------------ Minds are like parachutes, they only work when open |