Quick question

Ruby The Roobster michaeleverestc79 at gmail.com
Mon Feb 1 16:19:13 UTC 2021


On Saturday, 30 January 2021 at 01:57:53 UTC, Adam D. Ruppe wrote:
> On Saturday, 30 January 2021 at 00:58:09 UTC, Ruby The Roobster 
> wrote:
>> I have  question here. Is there a difference between .sizeof 
>> and .length(of a char[])?
>
> for future reference if someone stumbles on this, .sizeof is 
> the static size of the reference, .length is the actual length 
> of the array
>
> you pretty rarely want array.sizeof in D.

Thanks. However for a char[], .sizeof = .length because a char is 
one byte.


More information about the Digitalmars-d-learn mailing list