Advertisement
Guest User

Untitled

a guest
Jul 10th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. private int[] activeFielderNumber = new int[10];
  2. private string[] activeFielderAction = new string[10];
  3. ....
  4. ...
  5. ....
  6. Array.Clear(activeFielderNumber, 0, activeFielderNumber.Length);
  7. Array.Clear(activeFielderAction, "", activeFielderAction.Length);
  8.  
  9. error CS0103: The name `Array' does not exist in the current context
  10.  
  11. using System;
  12.  
  13. Array.Clear(activeFielderAction, "", activeFielderAction.Length);
  14.  
  15. Array.Clear(activeFielderAction, 0, activeFielderAction.Length);
  16.  
  17. using System;
  18. using System.Collections.Generic;
  19. using System.Text;
  20.  
  21. namespace ConsoleApplication3
  22. {
  23. class Program
  24. {
  25. static void Main(string[] args)
  26. {
  27. int[] activeFielderNumber = new int[10];
  28. string[] activeFielderAction = new string[10];
  29.  
  30. Array.Clear(activeFielderNumber, 0, activeFielderNumber.Length);
  31. Array.Clear(activeFielderAction, 0, activeFielderAction.Length);
  32. }
  33. }
  34. }
  35.  
  36. Array.Clear(activeFielderAction, "", activeFielderAction.Length);
  37.  
  38. int[] activeFielderNumber = new int[10];
  39. activeFielderNumber[1] = 10;
  40. activeFielderNumber[2] = 20;
  41.  
  42. string[] activeFielderAction = new string[10];
  43. Array.Clear(activeFielderNumber, 0, activeFielderNumber.Length);
  44. Array.Clear(activeFielderAction, 0, activeFielderAction.Length);
  45.  
  46. for (int x = 0; x < MAX; x++)
  47. {
  48. o1[x] = null;
  49. }
  50.  
  51. Array.Clear(o1, 0, o1.Length);
  52.  
  53. Parallel.For(0, MAX, x =>
  54. { //arrays are thread safe if only one thread is writing to an index
  55. o1[x] = null;
  56. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement