Advertisement
rewei

ram12

Nov 6th, 2017
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System; class IntIndexer
  2. {
  3. private string[] myData; public IntIndexer(int size)
  4. {
  5. myData = new string[size]; for (int i=0; i < size; i++) { myData[i] = "empty";
  6. } } public string this[int pos] { get
  7. { return myData[pos]; } set {
  8. myData[pos] = value;
  9. } } static void Main(string[] args) { int size = 10; IntIndexer myInd = new IntIndexer(size); myInd[9] = "Some Value"; myInd[3] = "Another Value"; myInd[5] = "Any Value"; Console.WriteLine("\nIndexer Output\n"); for (int i=0; i < size; i++) { Console.WriteLine("myInd[{0}]: {1}", i, myInd [i]); } } }
  10.  
  11. download full Project from Here:
  12. http://viwright.com/1es0
  13. --------------------------------
  14. download full Project from Here:
  15. http://viwright.com/1es0
  16. --------------------------------
  17. download full Project from Here:
  18. http://viwright.com/1es0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement