Advertisement
Ash_HeLiX

Untitled

Oct 17th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. int a = 10, b = 15, c = 0;
  4. SomeMul(a, b, c);
  5. char[] map = new char[15];
  6. map[2] = 'T';
  7. GenerateMap(map);
  8. Console.WriteLine(c); //Выведет 0 из void мы ничего не передаем
  9. Console.WriteLine(map[2]); //Выведет P ибо массив ссылочный
  10. }
  11. static void SomeMul(int a, int b, int c)
  12. {
  13. c = a * b;
  14. }
  15. static void GenerateMap(char[] map)
  16. {
  17. for (int i = 0; i < map.Length; i++)
  18. {
  19. map[i] = 'P';
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement