www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What does it mean void[]?

reply "Orfeo" <orfeo.davia gmail.com> writes:
I have found in the module 
https://github.com/NCrashed/serial-port/blob/master/source/serial/device.d
this function:

          void write(const(void[]) arr) {
             ...

What exactly is void[]? An array of pointers? An array of 
"anything"?

Thank you
Nov 15 2013
parent "Sergei Nosov" <sergei.nosov gmail.com> writes:
On Friday, 15 November 2013 at 09:19:04 UTC, Orfeo wrote:
 I have found in the module 
 https://github.com/NCrashed/serial-port/blob/master/source/serial/device.d
 this function:

          void write(const(void[]) arr) {
             ...

 What exactly is void[]? An array of pointers? An array of 
 "anything"?

 Thank you
It's semantics is "an array of octets". Similar, to "void *" in C++, except, the overall length in bytes is known.
Nov 15 2013