File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed
language/type/array/byte/return-in-function Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ function make-byteArray () {
2
+
3
+ [outputType ( [byte []] )]
4
+
5
+ [byte []] $byteArray = new-object byte[] 2
6
+
7
+ $byteArray [0 ] = 0
8
+ $byteArray [1 ] = 1
9
+
10
+ write-host " type of byteArray: $ ( $byteArray.GetType ().FullName) "
11
+
12
+ return $byteArray
13
+ }
14
+
15
+ $x = make- byteArray
16
+ write-host " type of x: $ ( $x.GetType ().FullName) "
Original file line number Diff line number Diff line change
1
+ #
2
+ # https://stackoverflow.com/a/61440166/180275
3
+ #
4
+ function make-byteArray () {
5
+
6
+ [outputType ( [byte []] )]
7
+
8
+ [byte []] $byteArray = new-object byte[] 2
9
+
10
+ $byteArray [0 ] = 0
11
+ $byteArray [1 ] = 1
12
+
13
+ , $byteArray
14
+ }
15
+
16
+ $x = make- byteArray
17
+ write-host " type of x: $ ( $x.GetType ().FullName) "
Original file line number Diff line number Diff line change
1
+ #
2
+ # https://stackoverflow.com/a/61440506/180275
3
+ #
4
+ function make-byteArray () {
5
+
6
+ [outputType ( [byte []] )]
7
+
8
+ [byte []] $byteArray = new-object byte[] 2
9
+
10
+ $byteArray [0 ] = 0
11
+ $byteArray [1 ] = 1
12
+
13
+ write-output - noEnumerate $byteArray
14
+ }
15
+
16
+ $x = make- byteArray
17
+ write-host " type of x: $ ( $x.GetType ().FullName) "
You can’t perform that action at this time.
0 commit comments