Originally Posted by
VernonDozier
Your program most assuredly does NOT run and does NOT work. It runs to completion if you insert a number in such a way so that it doesn't crash and it works under no circumstances as far as I can tell. Reread WaltP's and Denniz's comments. The program does not even do what you state that it does (putting the element in the FRONT of the array). Call your printIt function after you insert/delete and see what I mean, rather than using your cout statements inside of the functions. Also, try inserting a large number (i.e. 100) and see what happens. The cout statements in your insertion function are hindering, not helping, you to debug the program in my view, as they do not reflect what your array contents are after you insert.
Well, I was working on this project overnight, so I know I had a lot of mistakes in it. I think the main problem is that I have these variables, but I don't exactly know where they are suppose to go. I'm just following what the book told me to do as far as setting the program up in functions and the parameters etc.
Currently, the program runs, and when I do the removeAt function, it removes the numbers that I want to and the place I want it to be removed. It is just the InsertAt function is giving me trouble when I'm adding numbers. Whatever number I want to add, it just hits the front of the array instead of the position. I know my code for insertAt function is wrong, that is why I need help making the adjustment to this. One other problem I noticed was that I don't know how to keep looping when someone writes a number that is out of range. Can you specifically tell me what "index" is? Is that the same as position? Also, where is insertItem specifically suppose to go?