Hello,
I am looking for examples of inserting a value into an array on integers at a specific position in the array. Is there simplified way to accomplish this?
Hello,
I am looking for examples of inserting a value into an array on integers at a specific position in the array. Is there simplified way to accomplish this?
"Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
-Bruce Lee
Code:int array[10]; array[3] = 50;
Do you mean like having an array of four items, then populating the first three, then trying to insert an item as the first one? If so, I suggest that you use a linked list. It will save you a lot of time (both writing it and running it).
Thanks for your inputs! It helped
"Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
-Bruce Lee