What is the problem you're having?
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
This is going to involve a lot of shifting of values stored in the array. You will end up shifting to the left when deleting any element other than the last one, and shifting to right when you add at any element but the last one. To shift to the left you shift the left most element to be shifted first, and then work to the right. To shift to the right you move the right most element to be shifted first and then work to the left. If you can figure out how to insert and delete from the first element of the array, you will probably have an easier time inserting between elements.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
he's trying to trick people into doing his homework for him.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
I suspect the ultimate purpose of doing this exercise is to have the novice programmere experience for themselves the benefits of using pointers by having them add/delete/read forward/read backward from an array first and then show them how "easy" it is to do it with pointers and a list. At least that what is assume the original poster meant when saying:
i have a problem to simulate program on array-based list.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396