>How do u append in an array.
If u want to add at end then simply do
If you want to add at the beginning or somewhere in middle then you need to shift the elements to make space for the new element. >How do u subtract a number in an array.
I guess by this u mean removing an element...for this you need to shift elements again...which is very expensive.
If you have an array of 10 elements and you want to remove 5th element then u need to perform shifting of elements from 6th element so that, now element at 6th position becomes the element at 5th position, element at 5th position becomes the element at 4th position and so on...so that total elements are 1 less than before. >eh that didnt help me much
That was basic array tutorial meant to make u aware of what arrays are...proper undrstanding of it will make u solve such problems...anyways here's another tutorial link http://www.cplusplus.com/doc/tutorial/arrays.html
//Display all the numbers
//Deletion of position i :P
If you can only use pure arrays, then you will have to learn about dynamic memory allocation to modify the size of the array at run-time.
Or were you just asking if you want to put a new value into an array of a fixed size?
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...