We have an array in which we have some elements
we wish that user insert a value at a specified position in the array....
how is this done
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Feb 28, 2014, 5:57 AM
The output is:
a b c d e f
As the others have said, if you intend to do a lot of insertions, you're best using a List
VulpesPosted Feb 28, 2014, 6:07 AM
Abhijit PatilPosted Feb 28, 2014, 3:01 AM
you can use arraylist
Indices are zero based. So the first item is at index 0 and the tenth item at index 9
ArrayList.Insert
Abhay ShankerPosted Feb 27, 2014, 11:48 PM
http://stackoverflow.com/questions/9570944/adding-elements-to-a-c-sharp-array
But why are you not using arraylist