Skip to main content
added 37 characters in body
Source Link
TaW
  • 54.6k
  • 8
  • 74
  • 115

This works in two lines:

  int[] intArray = new int[20];
  new int[4] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Or even:

  int[] intArray = new int[20];
  new int[] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Note that the unnamed array goes out of scope right after the semicolon.. - I don't think it gets any simpler!

This works in two lines:

  int[] intArray = new int[20];
  new int[4] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Or even:

  int[] intArray = new int[20];
  new int[] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Note that the unnamed array goes out of scope right after the semicolon..

This works in two lines:

  int[] intArray = new int[20];
  new int[4] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Or even:

  int[] intArray = new int[20];
  new int[] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Note that the unnamed array goes out of scope right after the semicolon.. - I don't think it gets any simpler!

added 184 characters in body
Source Link
TaW
  • 54.6k
  • 8
  • 74
  • 115

This works in two lines:

  int[] intArray = new int[20];
  new int[4] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Or even:

  int[] intArray = new int[20];
  new int[] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Note that the unnamed array goes out of scope right after the semicolon..

This works in two lines:

  int[] intArray = new int[20];
  new int[4] {  20, 22, 23, 0 }.CopyTo(intArray , 0);

This works in two lines:

  int[] intArray = new int[20];
  new int[4] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Or even:

  int[] intArray = new int[20];
  new int[] { 20, 22, 23, 0 }.CopyTo(intArray , 0);

Note that the unnamed array goes out of scope right after the semicolon..

Source Link
TaW
  • 54.6k
  • 8
  • 74
  • 115

This works in two lines:

  int[] intArray = new int[20];
  new int[4] {  20, 22, 23, 0 }.CopyTo(intArray , 0);