I found this code
Stream foo() { ... return new MemoryStream(new[] { a, b }); }
and can guess what he is doing, but cannot find an explanation why the type definition byte[]can be omitted. I looked at msdn C # a new explanation, but it is too simple.
byte[]
You can create an implicitly typed array in which the type of the array instance is inferred from the elements specified in the array initializer. The rules for any implicitly typed variable also apply to implicitly typed arrays.
Taken from https://msdn.microsoft.com/en-us/library/bb384090.aspx
, .
# , , , , . , () , , c ++.
,
, , new byte[] { a, b }
new byte[] { a, b }
, byte[]
, , , a, b byte. , , byte s, .
a
b
byte
Microsoft . , var, .
var
with this, basically you create an array of objects implicitly!
Source: https://habr.com/ru/post/1654562/More articles:SQLite: .Net much slower than native? - performanceFacebook SDK (4.15.1) Login Crash (iOS8) - iosBest way to save chat messages in elasticsearch - elasticsearchHow to use the C11 standard in Code :: Blocks - cWhy valgrind does not detect a leak when the program was compiled with gcc-5.2.0 - cIgGrid: how to get odata queryString for remote filtering in JavaScript - uriIs there a fix for the grid height of the object inspector? Delphi 2010 - delphiExpress HTTP Proxy Error Handling - node.jsMULTIPART_FORM_DATA: Injection source not found for parameter of type Response - javaDelphi 2010 Object Inspector Infrastructure and Window Access Points - delphiAll Articles