Advertisement
Astekk

C# Understanding Arrays

Dec 31st, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. if you do not know what a array is or used for read this VV.
  2.  
  3. - A array is used the set more then one value to a variable.
  4. - Arrays are used highly in encryption & decryption scripts.
  5. - Arrays can be used for the application to add its self multiple variables depending on a file etc.
  6.  
  7.  
  8. How to make and set values to an array
  9.  
  10. A array is set as any other variable just with [] at the end.
  11. Int[] ArrayName;
  12. In the [] is where you set the amount of values you would like the variable to store.
  13. Int[3] ArrayName;
  14. To set a value in each array you will do this.
  15. NOTE: the system counts from 0 not 1 so always stay one behind.
  16. Int ArrayName[3];
  17. ArrayName[0] = 40;
  18. ArrayName[1] = 37;
  19. ArrayName[2] = 86;
  20. This is a faster way i use to set values.
  21.  
  22. Int ArrayName[3] = {40, 37, 86 };
  23.  
  24. How to set a number of values though a variable:
  25. There is not much needed to explain how this works,
  26. with basic knowledge of C# you will understand.
  27. Int ArrayName[] = { 37, 43, 54 };
  28. int i;
  29. for( i = 0; i<3; i++)
  30. {
  31. String Summary = "This Is Generated : " + ArrayName[i];
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement