c# - Why not have an array with a negative number as index? -


c# arrays, why not have array negative number index? situation useful; fast algorithm in special type of sorting. 2 questions: 1) why not? 2) efficient workaround?

you can implement own class indexer. example:

public class myclass {     public string this[int index] {         {             // ...          }          set {             // ...          }     } } 

where string return type example.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -