rply to lightatdown: it crashes before it even gets to there at the call of geline.
rply to lightatdown: it crashes before it even gets to there at the call of geline.
I haven't studied this whole thread (or the one before it) completely, but just looking at the code you just posted, here is what you must do to get it working:
[list=1][*]Change char *programs[30]; to char *programs[31]; or change all of your loops to stop at < 30 instead of <= 30. This is your crash.[*]Remove delete [] *programs; That will cause a crash also. The programs array was not allocated with new.[*]When you loop through programs and delete the char* strings, you must use delete [] programs[lp]; That is because all 30 (or 31) entries in the programs array are char arrays allocated with new [], so they must be deleted with delete [].[*]Now that your program doesn't crash, it doesn't do what you want because by using get you never get past the first word. You should probably do as others suggested with getline, but specifically for the code you last posted you can add the following:after you get the word into programs. I don't know why you need to do it that way, and I'm not sure that is the right way to fix your problem, but it worked for me.[/list=1]Code:char temp[2]; data.get(temp,2);
ECCP1... It's made you laugh, it's made you cry... it's made you want to beat the living $$$$ out of drdroid.... and finally as the last episode comes to an end... you'll be guessing until the end.
Ok, here goes... the last problem was... ::drum rooolll:: a couple things... the delete couldn't delete an empty char, it seemed to have a problem with that... and the loops were to big... besides destroying them... after page 3.5 the problem was pretty much solved...
The... end....
?
edit: but theres one.. major TWIST!!! SOMEONE MUST DIE!!!!
edit: LOOK OUT BEHIND YOU!!! ::screams:: ::bang:: NOOOOO!!!!
::sad piano music plays in the background... credits roll::
Thanks Salem, Lasunde, Jlou, Lightatdawn and Cat... this has really made me look back at everything to learn every detail... not that I'm going to drop this project... I learned alot... thanks again.
really.. this time...
THE END
Last edited by drdroid; 08-01-2003 at 09:04 PM.